diff --git a/contracts/access-control-registry/AccessControlRegistry.sol b/contracts/access-control-registry/AccessControlRegistry.sol index 6a833f12..ed6cf70e 100644 --- a/contracts/access-control-registry/AccessControlRegistry.sol +++ b/contracts/access-control-registry/AccessControlRegistry.sol @@ -1,9 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; -import "../utils/ExpiringMetaTxForwarder.sol"; import "../utils/SelfMulticall.sol"; import "./RoleDeriver.sol"; import "./interfaces/IAccessControlRegistry.sol"; @@ -18,16 +16,11 @@ import "./interfaces/IAccessControlRegistry.sol"; /// roles and grant these to accounts. Each role has a description, and roles /// adminned by the same role cannot have the same description. contract AccessControlRegistry is - ERC2771Context, AccessControl, - ExpiringMetaTxForwarder, SelfMulticall, RoleDeriver, IAccessControlRegistry { - /// @dev AccessControlRegistry is its own trusted meta-tx forwarder - constructor() ERC2771Context(address(this)) {} - /// @notice Initializes the manager by initializing its root role and /// granting it to them /// @dev Anyone can initialize a manager. An uninitialized manager @@ -95,26 +88,4 @@ contract AccessControlRegistry is } grantRole(role, _msgSender()); } - - /// @dev See Context.sol - function _msgSender() - internal - view - virtual - override(Context, ERC2771Context) - returns (address) - { - return ERC2771Context._msgSender(); - } - - /// @dev See Context.sol - function _msgData() - internal - view - virtual - override(Context, ERC2771Context) - returns (bytes calldata) - { - return ERC2771Context._msgData(); - } } diff --git a/contracts/access-control-registry/interfaces/IAccessControlRegistry.sol b/contracts/access-control-registry/interfaces/IAccessControlRegistry.sol index bbcae7ed..7a5829e4 100644 --- a/contracts/access-control-registry/interfaces/IAccessControlRegistry.sol +++ b/contracts/access-control-registry/interfaces/IAccessControlRegistry.sol @@ -2,14 +2,9 @@ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/IAccessControl.sol"; -import "../../utils/interfaces/IExpiringMetaTxForwarder.sol"; import "../../utils/interfaces/ISelfMulticall.sol"; -interface IAccessControlRegistry is - IAccessControl, - IExpiringMetaTxForwarder, - ISelfMulticall -{ +interface IAccessControlRegistry is IAccessControl, ISelfMulticall { event InitializedManager( bytes32 indexed rootRole, address indexed manager, diff --git a/contracts/allocators/Allocator.sol b/contracts/allocators/Allocator.sol index 7cfa78c5..d4b610bd 100644 --- a/contracts/allocators/Allocator.sol +++ b/contracts/allocators/Allocator.sol @@ -39,7 +39,7 @@ abstract contract Allocator is IAllocator { bytes32(0) ) { _resetSlot(airnode, slotIndex); - emit ResetSlot(airnode, slotIndex, _msgSender()); + emit ResetSlot(airnode, slotIndex, msg.sender); } } @@ -70,7 +70,7 @@ abstract contract Allocator is IAllocator { _resetSlot(airnode, slotIndex); airnodeToSlotIndexToSlot[airnode][slotIndex] = Slot({ subscriptionId: subscriptionId, - setter: _msgSender(), + setter: msg.sender, expirationTimestamp: expirationTimestamp }); emit SetSlot( @@ -78,7 +78,7 @@ abstract contract Allocator is IAllocator { slotIndex, subscriptionId, expirationTimestamp, - _msgSender() + msg.sender ); } @@ -87,12 +87,9 @@ abstract contract Allocator is IAllocator { /// @param slotIndex Index of the subscription slot to be reset function _resetSlot(address airnode, uint256 slotIndex) private { require( - slotCanBeResetByAccount(airnode, slotIndex, _msgSender()), + slotCanBeResetByAccount(airnode, slotIndex, msg.sender), "Cannot reset slot" ); delete airnodeToSlotIndexToSlot[airnode][slotIndex]; } - - /// @dev See Context.sol - function _msgSender() internal view virtual returns (address sender); } diff --git a/contracts/allocators/AllocatorWithAirnode.sol b/contracts/allocators/AllocatorWithAirnode.sol index c6757db6..ac0f0305 100644 --- a/contracts/allocators/AllocatorWithAirnode.sol +++ b/contracts/allocators/AllocatorWithAirnode.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "../access-control-registry/AccessControlRegistryAdminned.sol"; import "./Allocator.sol"; import "./interfaces/IAllocatorWithAirnode.sol"; @@ -9,7 +8,6 @@ import "./interfaces/IAllocatorWithAirnode.sol"; /// @title Contract that Airnode operators can use to temporarily /// allocate subscription slots for the respective Airnodes contract AllocatorWithAirnode is - ERC2771Context, AccessControlRegistryAdminned, Allocator, IAllocatorWithAirnode @@ -23,7 +21,6 @@ contract AllocatorWithAirnode is address _accessControlRegistry, string memory _adminRoleDescription ) - ERC2771Context(_accessControlRegistry) AccessControlRegistryAdminned( _accessControlRegistry, _adminRoleDescription @@ -43,7 +40,7 @@ contract AllocatorWithAirnode is uint32 expirationTimestamp ) external override { require( - hasSlotSetterRoleOrIsAirnode(airnode, _msgSender()), + hasSlotSetterRoleOrIsAirnode(airnode, msg.sender), "Sender cannot set slot" ); _setSlot(airnode, slotIndex, subscriptionId, expirationTimestamp); @@ -100,15 +97,4 @@ contract AllocatorWithAirnode is airnodeToSlotIndexToSlot[airnode][slotIndex].setter ); } - - /// @dev See Context.sol - function _msgSender() - internal - view - virtual - override(Allocator, ERC2771Context) - returns (address) - { - return ERC2771Context._msgSender(); - } } diff --git a/contracts/allocators/AllocatorWithManager.sol b/contracts/allocators/AllocatorWithManager.sol index 04640a49..5b055180 100644 --- a/contracts/allocators/AllocatorWithManager.sol +++ b/contracts/allocators/AllocatorWithManager.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "../access-control-registry/AccessControlRegistryAdminnedWithManager.sol"; import "./Allocator.sol"; import "./interfaces/IAllocatorWithManager.sol"; @@ -9,7 +8,6 @@ import "./interfaces/IAllocatorWithManager.sol"; /// @title Contract that Airnode operators can use to temporarily /// allocate subscription slots for Airnodes contract AllocatorWithManager is - ERC2771Context, AccessControlRegistryAdminnedWithManager, Allocator, IAllocatorWithManager @@ -25,7 +23,6 @@ contract AllocatorWithManager is string memory _adminRoleDescription, address _manager ) - ERC2771Context(_accessControlRegistry) AccessControlRegistryAdminnedWithManager( _accessControlRegistry, _adminRoleDescription, @@ -51,7 +48,7 @@ contract AllocatorWithManager is uint32 expirationTimestamp ) external override { require( - hasSlotSetterRoleOrIsManager(_msgSender()), + hasSlotSetterRoleOrIsManager(msg.sender), "Sender cannot set slot" ); _setSlot(airnode, slotIndex, subscriptionId, expirationTimestamp); @@ -84,15 +81,4 @@ contract AllocatorWithManager is airnodeToSlotIndexToSlot[airnode][slotIndex].setter ); } - - /// @dev See Context.sol - function _msgSender() - internal - view - virtual - override(Allocator, ERC2771Context) - returns (address) - { - return ERC2771Context._msgSender(); - } } diff --git a/contracts/authorizers/RequesterAuthorizer.sol b/contracts/authorizers/RequesterAuthorizer.sol index 964a6e12..7d65b710 100644 --- a/contracts/authorizers/RequesterAuthorizer.sol +++ b/contracts/authorizers/RequesterAuthorizer.sol @@ -64,7 +64,7 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { airnode, requester, expirationTimestamp, - _msgSender() + msg.sender ); } @@ -88,7 +88,7 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { airnode, requester, expirationTimestamp, - _msgSender() + msg.sender ); } @@ -112,11 +112,11 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { status && !airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][ requester - ][_msgSender()] + ][msg.sender] ) { airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][ requester - ][_msgSender()] = true; + ][msg.sender] = true; unchecked { indefiniteAuthorizationCount++; } @@ -126,11 +126,11 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { !status && airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][ requester - ][_msgSender()] + ][msg.sender] ) { airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][ requester - ][_msgSender()] = false; + ][msg.sender] = false; unchecked { indefiniteAuthorizationCount--; } @@ -142,7 +142,7 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { requester, status, indefiniteAuthorizationCount, - _msgSender() + msg.sender ); } @@ -181,7 +181,7 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { requester, setter, indefiniteAuthorizationCount, - _msgSender() + msg.sender ); } } @@ -203,7 +203,4 @@ abstract contract RequesterAuthorizer is IRequesterAuthorizer { authorizationStatus.indefiniteAuthorizationCount > 0 || authorizationStatus.expirationTimestamp > block.timestamp; } - - /// @dev See Context.sol - function _msgSender() internal view virtual returns (address sender); } diff --git a/contracts/authorizers/RequesterAuthorizerWithAirnode.sol b/contracts/authorizers/RequesterAuthorizerWithAirnode.sol index b95b52c4..737ef133 100644 --- a/contracts/authorizers/RequesterAuthorizerWithAirnode.sol +++ b/contracts/authorizers/RequesterAuthorizerWithAirnode.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "../access-control-registry/AccessControlRegistryAdminned.sol"; import "./RequesterAuthorizer.sol"; import "./interfaces/IRequesterAuthorizerWithAirnode.sol"; @@ -9,7 +8,6 @@ import "./interfaces/IRequesterAuthorizerWithAirnode.sol"; /// @title Authorizer contract that Airnode operators can use to temporarily or /// indefinitely authorize requesters for the respective Airnodes contract RequesterAuthorizerWithAirnode is - ERC2771Context, AccessControlRegistryAdminned, RequesterAuthorizer, IRequesterAuthorizerWithAirnode @@ -35,7 +33,6 @@ contract RequesterAuthorizerWithAirnode is address _accessControlRegistry, string memory _adminRoleDescription ) - ERC2771Context(_accessControlRegistry) AccessControlRegistryAdminned( _accessControlRegistry, _adminRoleDescription @@ -57,7 +54,7 @@ contract RequesterAuthorizerWithAirnode is require( hasAuthorizationExpirationExtenderRoleOrIsAirnode( airnode, - _msgSender() + msg.sender ), "Cannot extend expiration" ); @@ -79,7 +76,7 @@ contract RequesterAuthorizerWithAirnode is require( hasAuthorizationExpirationSetterRoleOrIsAirnode( airnode, - _msgSender() + msg.sender ), "Cannot set expiration" ); @@ -97,7 +94,7 @@ contract RequesterAuthorizerWithAirnode is bool status ) external override { require( - hasIndefiniteAuthorizerRoleOrIsAirnode(airnode, _msgSender()), + hasIndefiniteAuthorizerRoleOrIsAirnode(airnode, msg.sender), "Cannot set indefinite status" ); _setIndefiniteAuthorizationStatus(airnode, requester, status); @@ -227,15 +224,4 @@ contract RequesterAuthorizerWithAirnode is account ); } - - /// @dev See Context.sol - function _msgSender() - internal - view - virtual - override(RequesterAuthorizer, ERC2771Context) - returns (address) - { - return ERC2771Context._msgSender(); - } } diff --git a/contracts/authorizers/RequesterAuthorizerWithErc721.sol b/contracts/authorizers/RequesterAuthorizerWithErc721.sol index ee8d0f7c..20a901fa 100644 --- a/contracts/authorizers/RequesterAuthorizerWithErc721.sol +++ b/contracts/authorizers/RequesterAuthorizerWithErc721.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "../access-control-registry/AccessControlRegistryAdminned.sol"; import "./interfaces/IRequesterAuthorizerWithErc721.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; @@ -33,7 +32,6 @@ import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /// the requester to be blocked can still be authorized via the instances that /// have not been updated. contract RequesterAuthorizerWithErc721 is - ERC2771Context, AccessControlRegistryAdminned, IRequesterAuthorizerWithErc721 { @@ -106,7 +104,6 @@ contract RequesterAuthorizerWithErc721 is address _accessControlRegistry, string memory _adminRoleDescription ) - ERC2771Context(_accessControlRegistry) AccessControlRegistryAdminned( _accessControlRegistry, _adminRoleDescription @@ -122,16 +119,16 @@ contract RequesterAuthorizerWithErc721 is uint32 withdrawalLeadTime ) external override { require( - airnode == _msgSender() || + airnode == msg.sender || IAccessControlRegistry(accessControlRegistry).hasRole( deriveWithdrawalLeadTimeSetterRole(airnode), - _msgSender() + msg.sender ), "Sender cannot set lead time" ); require(withdrawalLeadTime <= 30 days, "Lead time too long"); airnodeToWithdrawalLeadTime[airnode] = withdrawalLeadTime; - emit SetWithdrawalLeadTime(airnode, withdrawalLeadTime, _msgSender()); + emit SetWithdrawalLeadTime(airnode, withdrawalLeadTime, msg.sender); } /// @notice Called by the Airnode or its requester blockers to set @@ -147,10 +144,10 @@ contract RequesterAuthorizerWithErc721 is bool status ) external override { require( - airnode == _msgSender() || + airnode == msg.sender || IAccessControlRegistry(accessControlRegistry).hasRole( deriveRequesterBlockerRole(airnode), - _msgSender() + msg.sender ), "Sender cannot block requester" ); @@ -164,7 +161,7 @@ contract RequesterAuthorizerWithErc721 is requester, chainId, status, - _msgSender() + msg.sender ); } @@ -179,16 +176,16 @@ contract RequesterAuthorizerWithErc721 is bool status ) external override { require( - airnode == _msgSender() || + airnode == msg.sender || IAccessControlRegistry(accessControlRegistry).hasRole( deriveDepositorFreezerRole(airnode), - _msgSender() + msg.sender ), "Sender cannot freeze depositor" ); require(depositor != address(0), "Depositor address zero"); airnodeToDepositorToFreezeStatus[airnode][depositor] = status; - emit SetDepositorFreezeStatus(airnode, depositor, status, _msgSender()); + emit SetDepositorFreezeStatus(airnode, depositor, status, msg.sender); } /// @notice Called by the ERC721 contract upon `safeTransferFrom()` to this @@ -226,7 +223,7 @@ contract RequesterAuthorizerWithErc721 is TokenDeposits storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[ airnode - ][chainId][requester][_msgSender()]; + ][chainId][requester][msg.sender]; uint256 tokenDepositCount; unchecked { tokenDepositCount = ++tokenDeposits.count; @@ -247,7 +244,7 @@ contract RequesterAuthorizerWithErc721 is requester, _from, chainId, - _msgSender(), + msg.sender, _tokenId, tokenDepositCount ); @@ -292,7 +289,7 @@ contract RequesterAuthorizerWithErc721 is "Next requester blocked" ); require( - !airnodeToDepositorToFreezeStatus[airnode][_msgSender()], + !airnodeToDepositorToFreezeStatus[airnode][msg.sender], "Depositor frozen" ); TokenDeposits @@ -301,7 +298,7 @@ contract RequesterAuthorizerWithErc721 is ][chainIdPrevious][requesterPrevious][token]; Deposit storage requesterPreviousDeposit = requesterPreviousTokenDeposits - .depositorToDeposit[_msgSender()]; + .depositorToDeposit[msg.sender]; if (requesterPreviousDeposit.state != DepositState.Active) { if (requesterPreviousDeposit.state == DepositState.Inactive) { revert("Token not deposited"); @@ -314,7 +311,7 @@ contract RequesterAuthorizerWithErc721 is airnode ][chainIdNext][requesterNext][token]; require( - requesterNextTokenDeposits.depositorToDeposit[_msgSender()].state == + requesterNextTokenDeposits.depositorToDeposit[msg.sender].state == DepositState.Inactive, "Token already deposited" ); @@ -326,14 +323,14 @@ contract RequesterAuthorizerWithErc721 is requesterPreviousTokenDeposits .count = requesterPreviousTokenDepositCount; uint256 tokenId = requesterPreviousDeposit.tokenId; - requesterNextTokenDeposits.depositorToDeposit[_msgSender()] = Deposit({ + requesterNextTokenDeposits.depositorToDeposit[msg.sender] = Deposit({ tokenId: tokenId, withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime, earliestWithdrawalTime: 0, state: DepositState.Active }); requesterPreviousTokenDeposits.depositorToDeposit[ - _msgSender() + msg.sender ] = Deposit({ tokenId: 0, withdrawalLeadTime: 0, @@ -343,7 +340,7 @@ contract RequesterAuthorizerWithErc721 is emit UpdatedDepositRequesterTo( airnode, requesterNext, - _msgSender(), + msg.sender, chainIdNext, token, tokenId, @@ -352,7 +349,7 @@ contract RequesterAuthorizerWithErc721 is emit UpdatedDepositRequesterFrom( airnode, requesterPrevious, - _msgSender(), + msg.sender, chainIdPrevious, token, tokenId, @@ -381,9 +378,7 @@ contract RequesterAuthorizerWithErc721 is storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[ airnode ][chainId][requester][token]; - Deposit storage deposit = tokenDeposits.depositorToDeposit[ - _msgSender() - ]; + Deposit storage deposit = tokenDeposits.depositorToDeposit[msg.sender]; if (deposit.state != DepositState.Active) { if (deposit.state == DepositState.Inactive) { revert("Token not deposited"); @@ -403,7 +398,7 @@ contract RequesterAuthorizerWithErc721 is emit InitiatedTokenWithdrawal( airnode, requester, - _msgSender(), + msg.sender, chainId, token, deposit.tokenId, @@ -430,16 +425,14 @@ contract RequesterAuthorizerWithErc721 is "Requester blocked" ); require( - !airnodeToDepositorToFreezeStatus[airnode][_msgSender()], + !airnodeToDepositorToFreezeStatus[airnode][msg.sender], "Depositor frozen" ); TokenDeposits storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[ airnode ][chainId][requester][token]; - Deposit storage deposit = tokenDeposits.depositorToDeposit[ - _msgSender() - ]; + Deposit storage deposit = tokenDeposits.depositorToDeposit[msg.sender]; require(deposit.state != DepositState.Inactive, "Token not deposited"); uint256 tokenDepositCount; if (deposit.state == DepositState.Active) { @@ -460,7 +453,7 @@ contract RequesterAuthorizerWithErc721 is } } uint256 tokenId = deposit.tokenId; - tokenDeposits.depositorToDeposit[_msgSender()] = Deposit({ + tokenDeposits.depositorToDeposit[msg.sender] = Deposit({ tokenId: 0, withdrawalLeadTime: 0, earliestWithdrawalTime: 0, @@ -469,13 +462,13 @@ contract RequesterAuthorizerWithErc721 is emit WithdrewToken( airnode, requester, - _msgSender(), + msg.sender, chainId, token, tokenId, tokenDepositCount ); - IERC721(token).safeTransferFrom(address(this), _msgSender(), tokenId); + IERC721(token).safeTransferFrom(address(this), msg.sender, tokenId); } /// @notice Called to revoke the token deposited to authorize a requester diff --git a/contracts/authorizers/RequesterAuthorizerWithManager.sol b/contracts/authorizers/RequesterAuthorizerWithManager.sol index 7f211eab..88a0b68e 100644 --- a/contracts/authorizers/RequesterAuthorizerWithManager.sol +++ b/contracts/authorizers/RequesterAuthorizerWithManager.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "../access-control-registry/AccessControlRegistryAdminnedWithManager.sol"; import "./RequesterAuthorizer.sol"; import "./interfaces/IRequesterAuthorizerWithManager.sol"; @@ -9,7 +8,6 @@ import "./interfaces/IRequesterAuthorizerWithManager.sol"; /// @title Authorizer contract that the manager can use to temporarily or /// indefinitely authorize requesters for Airnodes contract RequesterAuthorizerWithManager is - ERC2771Context, AccessControlRegistryAdminnedWithManager, RequesterAuthorizer, IRequesterAuthorizerWithManager @@ -31,7 +29,6 @@ contract RequesterAuthorizerWithManager is string memory _adminRoleDescription, address _manager ) - ERC2771Context(_accessControlRegistry) AccessControlRegistryAdminnedWithManager( _accessControlRegistry, _adminRoleDescription, @@ -73,7 +70,7 @@ contract RequesterAuthorizerWithManager is uint32 expirationTimestamp ) external override { require( - hasAuthorizationExpirationExtenderRoleOrIsManager(_msgSender()), + hasAuthorizationExpirationExtenderRoleOrIsManager(msg.sender), "Cannot extend expiration" ); _extendAuthorizationExpiration(airnode, requester, expirationTimestamp); @@ -92,7 +89,7 @@ contract RequesterAuthorizerWithManager is uint32 expirationTimestamp ) external override { require( - hasAuthorizationExpirationSetterRoleOrIsManager(_msgSender()), + hasAuthorizationExpirationSetterRoleOrIsManager(msg.sender), "Cannot set expiration" ); _setAuthorizationExpiration(airnode, requester, expirationTimestamp); @@ -109,7 +106,7 @@ contract RequesterAuthorizerWithManager is bool status ) external override { require( - hasIndefiniteAuthorizerRoleOrIsManager(_msgSender()), + hasIndefiniteAuthorizerRoleOrIsManager(msg.sender), "Cannot set indefinite status" ); _setIndefiniteAuthorizationStatus(airnode, requester, status); @@ -179,15 +176,4 @@ contract RequesterAuthorizerWithManager is account ); } - - /// @dev See Context.sol - function _msgSender() - internal - view - virtual - override(RequesterAuthorizer, ERC2771Context) - returns (address) - { - return ERC2771Context._msgSender(); - } } diff --git a/contracts/utils/ExpiringMetaTxForwarder.sol b/contracts/utils/ExpiringMetaTxForwarder.sol deleted file mode 100644 index 06a3a74b..00000000 --- a/contracts/utils/ExpiringMetaTxForwarder.sol +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/utils/Context.sol"; -import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "@openzeppelin/contracts/utils/Address.sol"; -import "./interfaces/IExpiringMetaTxForwarder.sol"; - -/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that -/// trust it -/// @notice `msg.value` is not supported. Identical meta-txes are not -/// supported. Target account must be a contract. Signer of the meta-tx is -/// allowed to cancel it before execution, effectively rendering the signature -/// useless. -/// This implementation is not intended to be used with general-purpose relayer -/// networks. Instead, it is meant for use-cases where the relayer wants the -/// signer to send a tx, so they request a meta-tx and execute it themselves to -/// cover the gas cost. -/// @dev This implementation does not use signer-specific nonces for meta-txes -/// to be executable in an arbitrary order. For example, one can sign two -/// meta-txes that will whitelist an account each and deliver these to the -/// respective owners of the accounts. This implementation allows the account -/// owners to not care about if and when the other meta-tx is executed. The -/// signer is responsible for not issuing signatures that may cause undesired -/// race conditions. -contract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder { - using ECDSA for bytes32; - using Address for address; - - /// @notice If the meta-tx with hash is executed or canceled - /// @dev We track this on a meta-tx basis and not by using nonces to avoid - /// requiring users keep track of nonces - mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled; - - bytes32 private constant _TYPEHASH = - keccak256( - "ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)" - ); - - constructor() EIP712("ExpiringMetaTxForwarder", "1.0.0") {} - - /// @notice Verifies the signature and executes the meta-tx - /// @param metaTx Meta-tx - /// @param signature Meta-tx hash signed by `from` - /// @return returndata Returndata - function execute( - ExpiringMetaTx calldata metaTx, - bytes calldata signature - ) external override returns (bytes memory returndata) { - bytes32 metaTxHash = processMetaTx(metaTx); - require( - metaTxHash.recover(signature) == metaTx.from, - "Invalid signature" - ); - emit ExecutedMetaTx(metaTxHash); - returndata = metaTx.to.functionCall( - abi.encodePacked(metaTx.data, metaTx.from) - ); - } - - /// @notice Called by a meta-tx source to prevent it from being executed - /// @dev This can be used to cancel meta-txes that were issued - /// accidentally, e.g., with an unreasonably large expiration timestamp, - /// which may create a dangling liability - /// @param metaTx Meta-tx - function cancel(ExpiringMetaTx calldata metaTx) external override { - require(_msgSender() == metaTx.from, "Sender not meta-tx source"); - emit CanceledMetaTx(processMetaTx(metaTx)); - } - - /// @notice Checks if the meta-tx is valid, invalidates it for future - /// execution or nullification, and returns the meta-tx hash - /// @param metaTx Meta-tx - /// @return metaTxHash Meta-tx hash - function processMetaTx( - ExpiringMetaTx calldata metaTx - ) private returns (bytes32 metaTxHash) { - metaTxHash = _hashTypedDataV4( - keccak256( - abi.encode( - _TYPEHASH, - metaTx.from, - metaTx.to, - keccak256(metaTx.data), - metaTx.expirationTimestamp - ) - ) - ); - require( - !metaTxWithHashIsExecutedOrCanceled[metaTxHash], - "Meta-tx executed or canceled" - ); - require( - metaTx.expirationTimestamp > block.timestamp, - "Meta-tx expired" - ); - metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true; - } -} diff --git a/contracts/utils/PrepaymentDepository.sol b/contracts/utils/PrepaymentDepository.sol deleted file mode 100644 index c438c752..00000000 --- a/contracts/utils/PrepaymentDepository.sol +++ /dev/null @@ -1,357 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.17; - -import "../access-control-registry/AccessControlRegistryAdminnedWithManager.sol"; -import "./interfaces/IPrepaymentDepository.sol"; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol"; - -/// @title Contract that enables micropayments to be prepaid in batch -/// @notice `manager` represents the payment recipient, and its various -/// privileges can be delegated to other accounts through respective roles. -/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only -/// be granted to a multisig or an equivalently decentralized account. -/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It -/// being compromised poses a risk in proportion to the redundancy in user -/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user -/// withdrawal limits as necessary to mitigate this risk. -/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it -/// cannot cause irreversible harm. -/// This contract accepts prepayments in an ERC20 token specified immutably -/// during construction. Do not use tokens that are not fully ERC20-compliant. -/// An optional `depositWithPermit()` function is added to provide ERC2612 -/// support. -contract PrepaymentDepository is - AccessControlRegistryAdminnedWithManager, - IPrepaymentDepository -{ - using ECDSA for bytes32; - - /// @notice Withdrawal signer role description - string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION = - "Withdrawal signer"; - /// @notice User withdrawal limit increaser role description - string - public constant - override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION = - "User withdrawal limit increaser"; - /// @notice User withdrawal limit decreaser role description - string - public constant - override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION = - "User withdrawal limit decreaser"; - /// @notice Claimer role description - string public constant override CLAIMER_ROLE_DESCRIPTION = "Claimer"; - - // We prefer revert strings over custom errors because not all chains and - // block explorers support custom errors - string private constant AMOUNT_ZERO_REVERT_STRING = "Amount zero"; - string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING = - "Amount exceeds limit"; - string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING = - "Transfer unsuccessful"; - - /// @notice Withdrawal signer role - bytes32 public immutable override withdrawalSignerRole; - /// @notice User withdrawal limit increaser role - bytes32 public immutable override userWithdrawalLimitIncreaserRole; - /// @notice User withdrawal limit decreaser role - bytes32 public immutable override userWithdrawalLimitDecreaserRole; - /// @notice Claimer role - bytes32 public immutable override claimerRole; - - /// @notice Contract address of the ERC20 token that prepayments can be - /// made in - address public immutable override token; - - /// @notice Returns the withdrawal destination of the user - mapping(address => address) public userToWithdrawalDestination; - - /// @notice Returns the withdrawal limit of the user - mapping(address => uint256) public userToWithdrawalLimit; - - /// @notice Returns if the withdrawal with the hash is executed - mapping(bytes32 => bool) public withdrawalWithHashIsExecuted; - - /// @param user User address - /// @param amount Amount - /// @dev Reverts if user address or amount is zero - modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) { - require(user != address(0), "User address zero"); - require(amount != 0, AMOUNT_ZERO_REVERT_STRING); - _; - } - - /// @param _accessControlRegistry AccessControlRegistry contract address - /// @param _adminRoleDescription Admin role description - /// @param _manager Manager address - /// @param _token Contract address of the ERC20 token that prepayments are - /// made in - constructor( - address _accessControlRegistry, - string memory _adminRoleDescription, - address _manager, - address _token - ) - AccessControlRegistryAdminnedWithManager( - _accessControlRegistry, - _adminRoleDescription, - _manager - ) - { - require(_token != address(0), "Token address zero"); - token = _token; - withdrawalSignerRole = _deriveRole( - _deriveAdminRole(manager), - WITHDRAWAL_SIGNER_ROLE_DESCRIPTION - ); - userWithdrawalLimitIncreaserRole = _deriveRole( - _deriveAdminRole(manager), - USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION - ); - userWithdrawalLimitDecreaserRole = _deriveRole( - _deriveAdminRole(manager), - USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION - ); - claimerRole = _deriveRole( - _deriveAdminRole(manager), - CLAIMER_ROLE_DESCRIPTION - ); - } - - /// @notice Called by the user that has not set a withdrawal destination to - /// set a withdrawal destination, or called by the withdrawal destination - /// of a user to set a new withdrawal destination - /// @param user User address - /// @param withdrawalDestination Withdrawal destination - function setWithdrawalDestination( - address user, - address withdrawalDestination - ) external override { - require(user != withdrawalDestination, "Same user and destination"); - require( - (msg.sender == user && - userToWithdrawalDestination[user] == address(0)) || - (msg.sender == userToWithdrawalDestination[user]), - "Sender not destination" - ); - userToWithdrawalDestination[user] = withdrawalDestination; - emit SetWithdrawalDestination(user, withdrawalDestination); - } - - /// @notice Called to increase the withdrawal limit of the user - /// @dev This function is intended to be used to revert faulty - /// `decreaseUserWithdrawalLimit()` calls - /// @param user User address - /// @param amount Amount to increase the withdrawal limit by - /// @return withdrawalLimit Increased withdrawal limit - function increaseUserWithdrawalLimit( - address user, - uint256 amount - ) - external - override - onlyNonZeroUserAddressAndAmount(user, amount) - returns (uint256 withdrawalLimit) - { - require( - msg.sender == manager || - IAccessControlRegistry(accessControlRegistry).hasRole( - userWithdrawalLimitIncreaserRole, - msg.sender - ), - "Cannot increase withdrawal limit" - ); - withdrawalLimit = userToWithdrawalLimit[user] + amount; - userToWithdrawalLimit[user] = withdrawalLimit; - emit IncreasedUserWithdrawalLimit( - user, - amount, - withdrawalLimit, - msg.sender - ); - } - - /// @notice Called to decrease the withdrawal limit of the user - /// @param user User address - /// @param amount Amount to decrease the withdrawal limit by - /// @return withdrawalLimit Decreased withdrawal limit - function decreaseUserWithdrawalLimit( - address user, - uint256 amount - ) - external - override - onlyNonZeroUserAddressAndAmount(user, amount) - returns (uint256 withdrawalLimit) - { - require( - msg.sender == manager || - IAccessControlRegistry(accessControlRegistry).hasRole( - userWithdrawalLimitDecreaserRole, - msg.sender - ), - "Cannot decrease withdrawal limit" - ); - uint256 oldWithdrawalLimit = userToWithdrawalLimit[user]; - require( - amount <= oldWithdrawalLimit, - AMOUNT_EXCEEDS_LIMIT_REVERT_STRING - ); - withdrawalLimit = oldWithdrawalLimit - amount; - userToWithdrawalLimit[user] = withdrawalLimit; - emit DecreasedUserWithdrawalLimit( - user, - amount, - withdrawalLimit, - msg.sender - ); - } - - /// @notice Called to claim tokens - /// @param recipient Recipient address - /// @param amount Amount of tokens to claim - function claim(address recipient, uint256 amount) external override { - require(recipient != address(0), "Recipient address zero"); - require(amount != 0, AMOUNT_ZERO_REVERT_STRING); - require( - msg.sender == manager || - IAccessControlRegistry(accessControlRegistry).hasRole( - claimerRole, - msg.sender - ), - "Cannot claim" - ); - emit Claimed(recipient, amount, msg.sender); - require( - IERC20(token).transfer(recipient, amount), - TRANSFER_UNSUCCESSFUL_REVERT_STRING - ); - } - - /// @notice Called to deposit tokens on behalf of a user - /// @param user User address - /// @param amount Amount of tokens to deposit - /// @return withdrawalLimit Increased withdrawal limit - function deposit( - address user, - uint256 amount - ) - public - override - onlyNonZeroUserAddressAndAmount(user, amount) - returns (uint256 withdrawalLimit) - { - withdrawalLimit = userToWithdrawalLimit[user] + amount; - userToWithdrawalLimit[user] = withdrawalLimit; - emit Deposited(user, amount, withdrawalLimit, msg.sender); - require( - IERC20(token).transferFrom(msg.sender, address(this), amount), - TRANSFER_UNSUCCESSFUL_REVERT_STRING - ); - } - - /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf - /// of a user - /// @param user User address - /// @param amount Amount of tokens to deposit - /// @param deadline Deadline of the permit - /// @param v v component of the signature - /// @param r r component of the signature - /// @param s s component of the signature - /// @return withdrawalLimit Increased withdrawal limit - function applyPermitAndDeposit( - address user, - uint256 amount, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) external override returns (uint256 withdrawalLimit) { - IERC20Permit(token).permit( - msg.sender, - address(this), - amount, - deadline, - v, - r, - s - ); - withdrawalLimit = deposit(user, amount); - } - - /// @notice Called by a user to withdraw tokens - /// @param amount Amount of tokens to withdraw - /// @param expirationTimestamp Expiration timestamp of the signature - /// @param withdrawalSigner Address of the account that signed the - /// withdrawal - /// @param signature Withdrawal signature - /// @return withdrawalDestination Withdrawal destination - /// @return withdrawalLimit Decreased withdrawal limit - function withdraw( - uint256 amount, - uint256 expirationTimestamp, - address withdrawalSigner, - bytes calldata signature - ) - external - override - returns (address withdrawalDestination, uint256 withdrawalLimit) - { - require(amount != 0, AMOUNT_ZERO_REVERT_STRING); - require(block.timestamp < expirationTimestamp, "Signature expired"); - bytes32 withdrawalHash = keccak256( - abi.encodePacked( - block.chainid, - address(this), - msg.sender, - amount, - expirationTimestamp - ) - ); - require( - !withdrawalWithHashIsExecuted[withdrawalHash], - "Withdrawal already executed" - ); - require( - withdrawalSigner == manager || - IAccessControlRegistry(accessControlRegistry).hasRole( - withdrawalSignerRole, - withdrawalSigner - ), - "Cannot sign withdrawal" - ); - require( - (withdrawalHash.toEthSignedMessageHash()).recover(signature) == - withdrawalSigner, - "Signature mismatch" - ); - withdrawalWithHashIsExecuted[withdrawalHash] = true; - uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender]; - require( - amount <= oldWithdrawalLimit, - AMOUNT_EXCEEDS_LIMIT_REVERT_STRING - ); - withdrawalLimit = oldWithdrawalLimit - amount; - userToWithdrawalLimit[msg.sender] = withdrawalLimit; - if (userToWithdrawalDestination[msg.sender] == address(0)) { - withdrawalDestination = msg.sender; - } else { - withdrawalDestination = userToWithdrawalDestination[msg.sender]; - } - emit Withdrew( - msg.sender, - withdrawalHash, - amount, - expirationTimestamp, - withdrawalSigner, - withdrawalDestination, - withdrawalLimit - ); - require( - IERC20(token).transfer(withdrawalDestination, amount), - TRANSFER_UNSUCCESSFUL_REVERT_STRING - ); - } -} diff --git a/contracts/utils/interfaces/IExpiringMetaTxForwarder.sol b/contracts/utils/interfaces/IExpiringMetaTxForwarder.sol deleted file mode 100644 index c75c28bf..00000000 --- a/contracts/utils/interfaces/IExpiringMetaTxForwarder.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -interface IExpiringMetaTxForwarder { - event ExecutedMetaTx(bytes32 indexed metaTxHash); - - event CanceledMetaTx(bytes32 indexed metaTxHash); - - struct ExpiringMetaTx { - address from; - address to; - bytes data; - uint256 expirationTimestamp; - } - - function execute( - ExpiringMetaTx calldata metaTx, - bytes calldata signature - ) external returns (bytes memory returndata); - - function cancel(ExpiringMetaTx calldata metaTx) external; - - function metaTxWithHashIsExecutedOrCanceled( - bytes32 metaTxHash - ) external returns (bool); -} diff --git a/contracts/utils/interfaces/IPrepaymentDepository.sol b/contracts/utils/interfaces/IPrepaymentDepository.sol deleted file mode 100644 index 17974690..00000000 --- a/contracts/utils/interfaces/IPrepaymentDepository.sol +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol"; - -interface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager { - event SetWithdrawalDestination( - address indexed user, - address withdrawalDestination - ); - - event IncreasedUserWithdrawalLimit( - address indexed user, - uint256 amount, - uint256 withdrawalLimit, - address sender - ); - - event DecreasedUserWithdrawalLimit( - address indexed user, - uint256 amount, - uint256 withdrawalLimit, - address sender - ); - - event Claimed(address recipient, uint256 amount, address sender); - - event Deposited( - address indexed user, - uint256 amount, - uint256 withdrawalLimit, - address sender - ); - - event Withdrew( - address indexed user, - bytes32 indexed withdrawalHash, - uint256 amount, - uint256 expirationTimestamp, - address withdrawalSigner, - address withdrawalDestination, - uint256 withdrawalLimit - ); - - function setWithdrawalDestination( - address user, - address withdrawalDestination - ) external; - - function increaseUserWithdrawalLimit( - address user, - uint256 amount - ) external returns (uint256 withdrawalLimit); - - function decreaseUserWithdrawalLimit( - address user, - uint256 amount - ) external returns (uint256 withdrawalLimit); - - function claim(address recipient, uint256 amount) external; - - function deposit( - address user, - uint256 amount - ) external returns (uint256 withdrawalLimit); - - function applyPermitAndDeposit( - address user, - uint256 amount, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) external returns (uint256 withdrawalLimit); - - function withdraw( - uint256 amount, - uint256 expirationTimestamp, - address withdrawalSigner, - bytes calldata signature - ) external returns (address withdrawalDestination, uint256 withdrawalLimit); - - // solhint-disable-next-line func-name-mixedcase - function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION() - external - view - returns (string memory); - - // solhint-disable-next-line func-name-mixedcase - function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION() - external - view - returns (string memory); - - // solhint-disable-next-line func-name-mixedcase - function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION() - external - view - returns (string memory); - - // solhint-disable-next-line func-name-mixedcase - function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory); - - function withdrawalSignerRole() external view returns (bytes32); - - function userWithdrawalLimitIncreaserRole() external view returns (bytes32); - - function userWithdrawalLimitDecreaserRole() external view returns (bytes32); - - function claimerRole() external view returns (bytes32); - - function token() external view returns (address); -} diff --git a/contracts/utils/mock/MockErc20PermitToken.sol b/contracts/utils/mock/MockErc20PermitToken.sol deleted file mode 100644 index f08e82e2..00000000 --- a/contracts/utils/mock/MockErc20PermitToken.sol +++ /dev/null @@ -1,122 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; -import "@openzeppelin/contracts/utils/Counters.sol"; - -// It is not possible to override the EIP712 version of -// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol -// so it is copy-pasted below with the version "2" to imitate USDC - -/** - * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in - * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. - * - * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by - * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't - * need to send a transaction, and thus is not required to hold Ether at all. - * - * _Available since v3.4._ - */ -abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { - using Counters for Counters.Counter; - - mapping(address => Counters.Counter) private _nonces; - - // solhint-disable-next-line var-name-mixedcase - bytes32 private constant _PERMIT_TYPEHASH = - keccak256( - "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" - ); - /** - * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`. - * However, to ensure consistency with the upgradeable transpiler, we will continue - * to reserve a slot. - * @custom:oz-renamed-from _PERMIT_TYPEHASH - */ - // solhint-disable-next-line var-name-mixedcase - bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT; - - /** - * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. - * - * It's a good idea to use the same `name` that is defined as the ERC20 token name. - */ - constructor(string memory name) EIP712(name, "2") {} - - /** - * @dev See {IERC20Permit-permit}. - */ - function permit( - address owner, - address spender, - uint256 value, - uint256 deadline, - uint8 v, - bytes32 r, - bytes32 s - ) public virtual override { - require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); - - bytes32 structHash = keccak256( - abi.encode( - _PERMIT_TYPEHASH, - owner, - spender, - value, - _useNonce(owner), - deadline - ) - ); - - bytes32 hash = _hashTypedDataV4(structHash); - - address signer = ECDSA.recover(hash, v, r, s); - require(signer == owner, "ERC20Permit: invalid signature"); - - _approve(owner, spender, value); - } - - /** - * @dev See {IERC20Permit-nonces}. - */ - function nonces( - address owner - ) public view virtual override returns (uint256) { - return _nonces[owner].current(); - } - - /** - * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. - */ - // solhint-disable-next-line func-name-mixedcase - function DOMAIN_SEPARATOR() external view override returns (bytes32) { - return _domainSeparatorV4(); - } - - /** - * @dev "Consume a nonce": return the current value and increment. - * - * _Available since v4.1._ - */ - function _useNonce( - address owner - ) internal virtual returns (uint256 current) { - Counters.Counter storage nonce = _nonces[owner]; - current = nonce.current(); - nonce.increment(); - } -} - -contract MockErc20PermitToken is ERC20Permit { - constructor(address recipient) ERC20("Token", "TKN") ERC20Permit("Token") { - _mint(recipient, 1e9 * 10 ** decimals()); - } - - function decimals() public view virtual override returns (uint8) { - return 6; - } -} diff --git a/contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol b/contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol deleted file mode 100644 index f7f1d227..00000000 --- a/contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; - -contract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable { - uint256 public counter = 0; - - constructor( - address _trustedForwarder, - address _owner - ) ERC2771Context(_trustedForwarder) { - _transferOwnership(_owner); - } - - function incrementCounter() external onlyOwner returns (uint256) { - return ++counter; - } - - function _msgSender() - internal - view - virtual - override(Context, ERC2771Context) - returns (address sender) - { - return ERC2771Context._msgSender(); - } - - function _msgData() - internal - view - virtual - override(Context, ERC2771Context) - returns (bytes calldata) - { - return ERC2771Context._msgData(); - } -} diff --git a/deploy/1_deploy.js b/deploy/1_deploy.js index 3dac1d78..a3772316 100644 --- a/deploy/1_deploy.js +++ b/deploy/1_deploy.js @@ -4,22 +4,13 @@ const { chainsSupportedByApi3Market, chainsSupportedByChainApi, chainsSupportedByDapis, - chainsSupportedByOevRelay, } = require('../src/supported-chains'); -const tokenAddresses = require('../src/token-addresses'); module.exports = async ({ getUnnamedAccounts, deployments }) => { const { deploy, log } = deployments; const accounts = await getUnnamedAccounts(); - if ( - [ - ...chainsSupportedByDapis, - ...chainsSupportedByChainApi, - 'ethereum-goerli-testnet', - 'ethereum-sepolia-testnet', - ].includes(network.name) - ) { + if ([...chainsSupportedByDapis, ...chainsSupportedByChainApi].includes(network.name)) { const accessControlRegistry = await deploy('AccessControlRegistry', { from: accounts[0], log: true, @@ -27,7 +18,7 @@ module.exports = async ({ getUnnamedAccounts, deployments }) => { }); log(`Deployed AccessControlRegistry at ${accessControlRegistry.address}`); - if ([...chainsSupportedByDapis, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name)) { + if (chainsSupportedByDapis.includes(network.name)) { const { address: ownableCallForwarderAddress, abi: ownableCallForwarderAbi } = await deploy( 'OwnableCallForwarder', { @@ -103,36 +94,7 @@ module.exports = async ({ getUnnamedAccounts, deployments }) => { log(`Deployed example DapiProxyWithOev at ${expectedDapiProxyWithOevAddress}`); } - if ([...chainsSupportedByOevRelay].includes(network.name)) { - let tokenAddress = tokenAddresses.usdc[network.name]; - if (!tokenAddress) { - const mockErc20PermitToken = await deploy('MockErc20PermitToken', { - from: accounts[0], - args: [accounts[0]], - log: true, - deterministicDeployment: process.env.DETERMINISTIC ? ethers.constants.HashZero : undefined, - }); - log(`Deployed MockErc20PermitToken at ${mockErc20PermitToken.address}`); - tokenAddress = mockErc20PermitToken.address; - } - - const prepaymentDepository = await deploy('PrepaymentDepository', { - from: accounts[0], - args: [ - accessControlRegistry.address, - 'PrepaymentDepository admin (OEV Relay)', - ownableCallForwarder.address, - tokenAddress, - ], - log: true, - deterministicDeployment: process.env.DETERMINISTIC ? ethers.constants.HashZero : undefined, - }); - log(`Deployed PrepaymentDepository (OEV Relay) at ${prepaymentDepository.address}`); - } - - if ( - [...chainsSupportedByApi3Market, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name) - ) { + if (chainsSupportedByApi3Market.includes(network.name)) { const orderPayable = await deploy('OrderPayable', { from: accounts[0], args: [accessControlRegistry.address, 'OrderPayable admin (API3 Market)', ownableCallForwarder.address], @@ -143,7 +105,7 @@ module.exports = async ({ getUnnamedAccounts, deployments }) => { } } - if ([...chainsSupportedByChainApi, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name)) { + if (chainsSupportedByChainApi.includes(network.name)) { const requesterAuthorizerWithErc721 = await deploy('RequesterAuthorizerWithErc721', { from: accounts[0], args: [accessControlRegistry.address, 'RequesterAuthorizerWithErc721 admin'], diff --git a/deploy/2_document.js b/deploy/2_document.js index c0ec7b9a..7c705019 100644 --- a/deploy/2_document.js +++ b/deploy/2_document.js @@ -5,19 +5,12 @@ const { chainsSupportedByApi3Market, chainsSupportedByChainApi, chainsSupportedByDapis, - chainsSupportedByOevRelay, } = require('../src/supported-chains'); -const tokenAddresses = require('../src/token-addresses'); module.exports = async () => { const references = {}; references.chainNames = {}; - for (const network of [ - ...chainsSupportedByApi3Market, - ...chainsSupportedByChainApi, - ...chainsSupportedByDapis, - ...chainsSupportedByOevRelay, - ]) { + for (const network of [...chainsSupportedByApi3Market, ...chainsSupportedByChainApi, ...chainsSupportedByDapis]) { references.chainNames[hre.config.networks[network].chainId] = network; } const deploymentBlockNumbers = { chainNames: references.chainNames }; @@ -25,12 +18,7 @@ module.exports = async () => { for (const contractName of ['AccessControlRegistry']) { references[contractName] = {}; deploymentBlockNumbers[contractName] = {}; - for (const network of [ - ...chainsSupportedByDapis, - ...chainsSupportedByChainApi, - 'ethereum-goerli-testnet', - 'ethereum-sepolia-testnet', - ]) { + for (const network of [...chainsSupportedByDapis, ...chainsSupportedByChainApi]) { const deployment = JSON.parse(fs.readFileSync(path.join('deployments', network, `${contractName}.json`), 'utf8')); references[contractName][hre.config.networks[network].chainId] = deployment.address; if (deployment.receipt) { @@ -44,24 +32,7 @@ module.exports = async () => { for (const contractName of ['OwnableCallForwarder', 'Api3ServerV1', 'ProxyFactory']) { references[contractName] = {}; deploymentBlockNumbers[contractName] = {}; - for (const network of [...chainsSupportedByDapis, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet']) { - const deployment = JSON.parse(fs.readFileSync(path.join('deployments', network, `${contractName}.json`), 'utf8')); - references[contractName][hre.config.networks[network].chainId] = deployment.address; - if (deployment.receipt) { - deploymentBlockNumbers[contractName][hre.config.networks[network].chainId] = deployment.receipt.blockNumber; - } else { - deploymentBlockNumbers[contractName][hre.config.networks[network].chainId] = 'MISSING'; - } - } - } - - for (const contractName of ['MockErc20PermitToken', 'PrepaymentDepository']) { - references[contractName] = {}; - deploymentBlockNumbers[contractName] = {}; - for (const network of [...chainsSupportedByOevRelay]) { - if (contractName === 'MockErc20PermitToken' && tokenAddresses.usdc[network]) { - continue; - } + for (const network of chainsSupportedByDapis) { const deployment = JSON.parse(fs.readFileSync(path.join('deployments', network, `${contractName}.json`), 'utf8')); references[contractName][hre.config.networks[network].chainId] = deployment.address; if (deployment.receipt) { @@ -75,7 +46,7 @@ module.exports = async () => { for (const contractName of ['OrderPayable']) { references[contractName] = {}; deploymentBlockNumbers[contractName] = {}; - for (const network of [...chainsSupportedByApi3Market, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet']) { + for (const network of chainsSupportedByApi3Market) { const deployment = JSON.parse(fs.readFileSync(path.join('deployments', network, `${contractName}.json`), 'utf8')); references[contractName][hre.config.networks[network].chainId] = deployment.address; if (deployment.receipt) { @@ -89,7 +60,7 @@ module.exports = async () => { for (const contractName of ['RequesterAuthorizerWithErc721']) { references[contractName] = {}; deploymentBlockNumbers[contractName] = {}; - for (const network of [...chainsSupportedByChainApi, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet']) { + for (const network of chainsSupportedByChainApi) { const deployment = JSON.parse(fs.readFileSync(path.join('deployments', network, `${contractName}.json`), 'utf8')); references[contractName][hre.config.networks[network].chainId] = deployment.address; if (deployment.receipt) { diff --git a/deploy/3_verify.js b/deploy/3_verify.js index ce928825..c917bd5e 100644 --- a/deploy/3_verify.js +++ b/deploy/3_verify.js @@ -4,27 +4,18 @@ const { chainsSupportedByApi3Market, chainsSupportedByChainApi, chainsSupportedByDapis, - chainsSupportedByOevRelay, } = require('../src/supported-chains'); -const tokenAddresses = require('../src/token-addresses'); module.exports = async ({ getUnnamedAccounts, deployments }) => { const accounts = await getUnnamedAccounts(); - if ( - [ - ...chainsSupportedByDapis, - ...chainsSupportedByChainApi, - 'ethereum-goerli-testnet', - 'ethereum-sepolia-testnet', - ].includes(network.name) - ) { + if ([...chainsSupportedByDapis, ...chainsSupportedByChainApi].includes(network.name)) { const AccessControlRegistry = await deployments.get('AccessControlRegistry'); await hre.run('verify:verify', { address: AccessControlRegistry.address, }); - if ([...chainsSupportedByDapis, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name)) { + if (chainsSupportedByDapis.includes(network.name)) { const OwnableCallForwarder = await deployments.get('OwnableCallForwarder'); await hre.run('verify:verify', { address: OwnableCallForwarder.address, @@ -84,32 +75,7 @@ module.exports = async ({ getUnnamedAccounts, deployments }) => { ], }); - if ([...chainsSupportedByOevRelay].includes(network.name)) { - let tokenAddress = tokenAddresses.usdc[network.name]; - if (!tokenAddress) { - const MockErc20PermitToken = await deployments.get('MockErc20PermitToken'); - await hre.run('verify:verify', { - address: MockErc20PermitToken.address, - constructorArguments: [accounts[0]], - }); - tokenAddress = MockErc20PermitToken.address; - } - - const PrepaymentDepository = await deployments.get('PrepaymentDepository'); - await hre.run('verify:verify', { - address: PrepaymentDepository.address, - constructorArguments: [ - AccessControlRegistry.address, - 'PrepaymentDepository admin (OEV Relay)', - OwnableCallForwarder.address, - tokenAddress, - ], - }); - } - - if ( - [...chainsSupportedByApi3Market, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name) - ) { + if (chainsSupportedByApi3Market.includes(network.name)) { const OrderPayable = await deployments.get('OrderPayable'); await hre.run('verify:verify', { address: OrderPayable.address, @@ -122,7 +88,7 @@ module.exports = async ({ getUnnamedAccounts, deployments }) => { } } - if ([...chainsSupportedByChainApi, 'ethereum-goerli-testnet', 'ethereum-sepolia-testnet'].includes(network.name)) { + if (chainsSupportedByChainApi.includes(network.name)) { const RequesterAuthorizerWithErc721 = await deployments.get('RequesterAuthorizerWithErc721'); await hre.run('verify:verify', { address: RequesterAuthorizerWithErc721.address, diff --git a/deployments/arbitrum-goerli-testnet/AccessControlRegistry.json b/deployments/arbitrum-goerli-testnet/AccessControlRegistry.json index f0f2e704..97165f9e 100644 --- a/deployments/arbitrum-goerli-testnet/AccessControlRegistry.json +++ b/deployments/arbitrum-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0xdb6a0912870e4ab31c54b5723cdddd6946e0235f21b2b793468302900a4dee1d", + "transactionHash": "0xf311192c5c8a4c381c5e6ee731cb2bed1f9d8c3c3d80d9effd84401dac46a03b", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 1, - "gasUsed": { "type": "BigNumber", "hex": "0x03001a8b" }, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xec867f9c7a5d86353c6f700a05d12f9e035cdfd102eb9a8259e6f8840f9381da", - "transactionHash": "0xdb6a0912870e4ab31c54b5723cdddd6946e0235f21b2b793468302900a4dee1d", + "blockHash": "0x35013fdc724165da3b066c601010420fa2991ad3979a47f4a23d2edd3d93733f", + "transactionHash": "0xf311192c5c8a4c381c5e6ee731cb2bed1f9d8c3c3d80d9effd84401dac46a03b", "logs": [], - "blockNumber": 11400046, - "confirmations": 2450572, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x03001a8b" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x05f5e100" }, + "blockNumber": 58263197, + "cumulativeGasUsed": "1061718", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/arbitrum-goerli-testnet/Api3ServerV1.json b/deployments/arbitrum-goerli-testnet/Api3ServerV1.json index f390344c..57fd8459 100644 --- a/deployments/arbitrum-goerli-testnet/Api3ServerV1.json +++ b/deployments/arbitrum-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x896c7d8d7f1a641b343eca3b4014780a556da45b4d6ddef1000c00c05576cb7d", + "transactionHash": "0x51b3a6114a1780d4aa0c52ce2eb6949bee7e0845af22234eb65cf28b9204ae77", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 1, - "gasUsed": "4422900", + "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xcd86781d05de938f0ae02554857196b1f12b1112c4af07cbae3bd2a7165d8dae", - "transactionHash": "0x896c7d8d7f1a641b343eca3b4014780a556da45b4d6ddef1000c00c05576cb7d", + "blockHash": "0xb1c93176af84a6f4333e2fcbe130daf132caa8b7edb217b7b7ed9401b2ef1eb0", + "transactionHash": "0x51b3a6114a1780d4aa0c52ce2eb6949bee7e0845af22234eb65cf28b9204ae77", "logs": [], - "blockNumber": 11748727, - "cumulativeGasUsed": "4422900", + "blockNumber": 58263206, + "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/arbitrum-goerli-testnet/ProxyFactory.json b/deployments/arbitrum-goerli-testnet/ProxyFactory.json index fb8a7a1b..1b664de8 100644 --- a/deployments/arbitrum-goerli-testnet/ProxyFactory.json +++ b/deployments/arbitrum-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xb10ad95d93989545f838416d23d99c929bc81748b2751a15f2ed8045ff2da459", + "transactionHash": "0xd5d451aa76040c911537c5637a07f229a3a7c76689e7defe9b4d864ae5a4fd9d", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 1, - "gasUsed": "1991551", + "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x112e25b9b01b7f14c72072a8ea6cacc51d1c3716391bfaa86fc99081b0808585", - "transactionHash": "0xb10ad95d93989545f838416d23d99c929bc81748b2751a15f2ed8045ff2da459", + "blockHash": "0x4c77ba9d90ef8259a93928db7b0c7b42d440e269941826e45180cc1601c0af9f", + "transactionHash": "0xd5d451aa76040c911537c5637a07f229a3a7c76689e7defe9b4d864ae5a4fd9d", "logs": [], - "blockNumber": 11748733, - "cumulativeGasUsed": "1991551", + "blockNumber": 58263211, + "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/arbitrum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/arbitrum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/arbitrum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/arbitrum/AccessControlRegistry.json b/deployments/arbitrum/AccessControlRegistry.json index 7e498e22..90fbb912 100644 --- a/deployments/arbitrum/AccessControlRegistry.json +++ b/deployments/arbitrum/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x4f221cdd8407c4f9eb9eaa793a820e03e246240d1d88227c5be8bcceed47d52f", + "transactionHash": "0x7b6aefb19a8c843cc34792984d30a9c24fd011d73304925f2ea1557c15cff541", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "16168473", + "transactionIndex": 1, + "gasUsed": "13907804", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x25f773c227a90ef287c21f7628c5826e553d2554fbb695fd6183b80888a51b57", - "transactionHash": "0x4f221cdd8407c4f9eb9eaa793a820e03e246240d1d88227c5be8bcceed47d52f", + "blockHash": "0x44342089b710fa14aeb3f34cdc5e5183e6926bf75c02e15e66bae81908fd9596", + "transactionHash": "0x7b6aefb19a8c843cc34792984d30a9c24fd011d73304925f2ea1557c15cff541", "logs": [], - "blockNumber": 70478595, - "cumulativeGasUsed": "17604125", + "blockNumber": 157740807, + "cumulativeGasUsed": "13907804", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/arbitrum/Api3ServerV1.json b/deployments/arbitrum/Api3ServerV1.json index 60606356..520ed8ea 100644 --- a/deployments/arbitrum/Api3ServerV1.json +++ b/deployments/arbitrum/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xcbe6ef252486a74961ee2fb21ed6c4827759e3467a9a1128a26d2b3f5053726a", + "transactionHash": "0xb04d9154af903b07e0c5d9cc0017556ffb31f9f499901ca8542115239ae2c05f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 5, - "gasUsed": "27055433", + "transactionIndex": 3, + "gasUsed": "36652886", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x72434ed70855f7ba2345f1170cdada5b990385a27f4fe6106ec0b3d8b557572e", - "transactionHash": "0xcbe6ef252486a74961ee2fb21ed6c4827759e3467a9a1128a26d2b3f5053726a", + "blockHash": "0x4eef6d64c9041ab14e79b08d2efa5f4f5261fd1255d43be9e6abb8503104c199", + "transactionHash": "0xb04d9154af903b07e0c5d9cc0017556ffb31f9f499901ca8542115239ae2c05f", "logs": [], - "blockNumber": 70478684, - "cumulativeGasUsed": "31883274", + "blockNumber": 157740828, + "cumulativeGasUsed": "41622492", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/arbitrum/OrderPayable.json b/deployments/arbitrum/OrderPayable.json index 7d6bf9a2..dc2ca81e 100644 --- a/deployments/arbitrum/OrderPayable.json +++ b/deployments/arbitrum/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x25fad9ee61e4ef03a81eb95bea659ece73fe0d66697d13f03a7c93fab58f8af9", + "transactionHash": "0xd7f782978c68b24bd70d5e149ac9e3b87234bcf06f57061baf4b9b25ee312999", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 4, - "gasUsed": "12194791", + "transactionIndex": 2, + "gasUsed": "34434517", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa0173aff11b221927d279b63da94f75ca810f1463703c700d341da5f23360e3c", - "transactionHash": "0x25fad9ee61e4ef03a81eb95bea659ece73fe0d66697d13f03a7c93fab58f8af9", + "blockHash": "0xafd7aa866b040d0288af88ad3bf398347dbda3f945b8437946a41439bd3fddeb", + "transactionHash": "0xd7f782978c68b24bd70d5e149ac9e3b87234bcf06f57061baf4b9b25ee312999", "logs": [], - "blockNumber": 94242635, - "cumulativeGasUsed": "15008853", + "blockNumber": 157788064, + "cumulativeGasUsed": "36699015", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/arbitrum/ProxyFactory.json b/deployments/arbitrum/ProxyFactory.json index d7ee8e0b..581c0412 100644 --- a/deployments/arbitrum/ProxyFactory.json +++ b/deployments/arbitrum/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xdecad030355a634a628bad13cb81110fbe3926e5da3ca0f053faf1f57dac1998", + "transactionHash": "0x2f31ba8a12ff45daa6ec5a97a0c2be322c17fc2160113bf09b6dc8084ed8b862", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "9916562", + "transactionIndex": 1, + "gasUsed": "13297461", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x398334a5ba4f2010940eb542ae3e31e6c04d328ff09f8a79edda999c6e97daf7", - "transactionHash": "0xdecad030355a634a628bad13cb81110fbe3926e5da3ca0f053faf1f57dac1998", + "blockHash": "0xc9b2384378c8c4d446fcd546fff12754b777944872d0d5edbbb46da8d2e21416", + "transactionHash": "0x2f31ba8a12ff45daa6ec5a97a0c2be322c17fc2160113bf09b6dc8084ed8b862", "logs": [], - "blockNumber": 70478707, - "cumulativeGasUsed": "10480529", + "blockNumber": 157740846, + "cumulativeGasUsed": "13297461", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/arbitrum/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/arbitrum/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/arbitrum/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/avalanche-testnet/AccessControlRegistry.json b/deployments/avalanche-testnet/AccessControlRegistry.json index f66f43c1..2737d4fc 100644 --- a/deployments/avalanche-testnet/AccessControlRegistry.json +++ b/deployments/avalanche-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x84be469da451667fe45852bef9f4c1387f7eae93968c89b50ce3b36288547adb", + "transactionHash": "0x5b789fd322885687cb090cfbba4349016fadb957729b8a25d3a0c6a648f1bc63", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, + "transactionIndex": 4, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xedafb6bd831e8cd043a4b92d437433f8e31bc4cc600d895f6324c600dcb2bb8a", - "transactionHash": "0x84be469da451667fe45852bef9f4c1387f7eae93968c89b50ce3b36288547adb", + "blockHash": "0xe7c2fdca23d956dd1ad940c1c99995dd8afcc3be3130bc34ff18db86407b82a0", + "transactionHash": "0x5b789fd322885687cb090cfbba4349016fadb957729b8a25d3a0c6a648f1bc63", "logs": [], - "blockNumber": 19832625, - "confirmations": 476739, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x05d21dba00" }, + "blockNumber": 28376781, + "cumulativeGasUsed": "1454349", "status": 1, - "type": 0, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/avalanche-testnet/Api3ServerV1.json b/deployments/avalanche-testnet/Api3ServerV1.json index 154e5065..1ca60b71 100644 --- a/deployments/avalanche-testnet/Api3ServerV1.json +++ b/deployments/avalanche-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0x48bdcd35c8904600a7de9d5b0c4d9b8646cb26ab8cfc225988b573744c0acaa7", + "transactionHash": "0xf6fea2c76ea1667bceb4c06d69e05ad3c6db3b727eff7a98f48e9cd315500879", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf4f65a0a370d0a555bd44cfc409b908cf5f4d54862c09b5699097410246f2836", - "transactionHash": "0x48bdcd35c8904600a7de9d5b0c4d9b8646cb26ab8cfc225988b573744c0acaa7", + "blockHash": "0x9475dc7e368a646930ca57ffacc87aa6a9a6fbd4b660bcdeed4785ed62136439", + "transactionHash": "0xf6fea2c76ea1667bceb4c06d69e05ad3c6db3b727eff7a98f48e9cd315500879", "logs": [], - "blockNumber": 19914010, + "blockNumber": 28376782, "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/avalanche-testnet/ProxyFactory.json b/deployments/avalanche-testnet/ProxyFactory.json index 5911e805..774cfe44 100644 --- a/deployments/avalanche-testnet/ProxyFactory.json +++ b/deployments/avalanche-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xd73f955a88076b8159ee397fa36b6816de4c62d41027d769cb0b6704ac041ec7", + "transactionHash": "0x0d38d0dc480ccb73b18fc5efaaff3b9a06d2d045df5eefeb52f987c75fff0843", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 1, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x3e853316ec51c3b318a5a4746305bce54ee7fc0fa23f0b748262f94e1ebb2aa6", - "transactionHash": "0xd73f955a88076b8159ee397fa36b6816de4c62d41027d769cb0b6704ac041ec7", + "blockHash": "0xa12cc7e1ca2192f712e01f4906ee69a960a3d6f0a2a0c3009c2a319d6e9c650f", + "transactionHash": "0x0d38d0dc480ccb73b18fc5efaaff3b9a06d2d045df5eefeb52f987c75fff0843", "logs": [], - "blockNumber": 19914013, - "cumulativeGasUsed": "1472737", + "blockNumber": 28376785, + "cumulativeGasUsed": "1532933", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/avalanche-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/avalanche-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/avalanche-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/avalanche/AccessControlRegistry.json b/deployments/avalanche/AccessControlRegistry.json index b9f12a0d..6cb27fe1 100644 --- a/deployments/avalanche/AccessControlRegistry.json +++ b/deployments/avalanche/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x7c89a79d7d334f219d3aa8698403248b1eeadfc35d7ae864a3daea92b8700299", + "transactionHash": "0x4b27102ed4a346741ee43aad740f1cb34149a1223b77cda7605fdd0679ec55e7", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 5, - "gasUsed": "1720828", + "transactionIndex": 20, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5d53d514eacfc81745e173b78c54e5ee35e81fff66c0e526b7baee4c9c1680c6", - "transactionHash": "0x7c89a79d7d334f219d3aa8698403248b1eeadfc35d7ae864a3daea92b8700299", + "blockHash": "0x98b4851e9d606288565e9f5d6df04ca8da57586494d0fd56d7a01941ca92bbf7", + "transactionHash": "0x4b27102ed4a346741ee43aad740f1cb34149a1223b77cda7605fdd0679ec55e7", "logs": [], - "blockNumber": 27521424, - "cumulativeGasUsed": "3142065", + "blockNumber": 38734650, + "cumulativeGasUsed": "2113628", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/avalanche/Api3ServerV1.json b/deployments/avalanche/Api3ServerV1.json index 823ac733..7a48c494 100644 --- a/deployments/avalanche/Api3ServerV1.json +++ b/deployments/avalanche/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x2fb9aed332ed65edf81bf95e3bfaa3bae72cf72f2f91ffec2c7aa122e32e1a71", + "transactionHash": "0x184c32a40fd30fff68cf1b6919a4c1a41603d34a6bf85a31b6f20663a7f268ab", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, + "transactionIndex": 30, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xef92e6750651d036fd82beaf5a73deedad4ad20fbb22f79c67d3adcbf6cc4f93", - "transactionHash": "0x2fb9aed332ed65edf81bf95e3bfaa3bae72cf72f2f91ffec2c7aa122e32e1a71", + "blockHash": "0xcfd339f1788ece57013ce20bef8316f384fa992bc849398f28c481fd1bc4da6d", + "transactionHash": "0x184c32a40fd30fff68cf1b6919a4c1a41603d34a6bf85a31b6f20663a7f268ab", "logs": [], - "blockNumber": 27521435, - "cumulativeGasUsed": "3006985", + "blockNumber": 38734652, + "cumulativeGasUsed": "4022133", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/avalanche/OrderPayable.json b/deployments/avalanche/OrderPayable.json index 028566d1..59b13263 100644 --- a/deployments/avalanche/OrderPayable.json +++ b/deployments/avalanche/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x7771c2ba6b5b258fe072c83ea666f336a715a9eed90a86432aae92d550e328c2", + "transactionHash": "0x7bac30a7c30f88cd707aee0f01eefe39a587b4fce1d585366bf537a036a234ed", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 18, + "transactionIndex": 58, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xca7b3571a13b3fa40f2710700505f2f8e8dcc6bab3ada2e744c0e7af33e63905", - "transactionHash": "0x7771c2ba6b5b258fe072c83ea666f336a715a9eed90a86432aae92d550e328c2", + "blockHash": "0x8d794d869ce384eda4d20c8bcaf3c77f47bd7cb15ac32b87ba109197e55b802c", + "transactionHash": "0x7bac30a7c30f88cd707aee0f01eefe39a587b4fce1d585366bf537a036a234ed", "logs": [], - "blockNumber": 30469801, - "cumulativeGasUsed": "7782978", + "blockNumber": 38740595, + "cumulativeGasUsed": "3545113", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/avalanche/ProxyFactory.json b/deployments/avalanche/ProxyFactory.json index 42de7219..9aed662b 100644 --- a/deployments/avalanche/ProxyFactory.json +++ b/deployments/avalanche/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xe7999a1b89fcfd971eeedd96a1ba52477bba039b09a2567d356fee4c570f7831", + "transactionHash": "0xbf2c30095baad9c057c5355b5b2456ee4749e39ffbf19191d1babe41012334b3", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, + "transactionIndex": 25, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7e5eb2a67ef92b9d41032f23b0aca40690045091ea770077593e94d72aab237f", - "transactionHash": "0xe7999a1b89fcfd971eeedd96a1ba52477bba039b09a2567d356fee4c570f7831", + "blockHash": "0x35937260da3324784d7edab93f40e71ae9c3884b705e15f5ade3f70ef6c43099", + "transactionHash": "0xbf2c30095baad9c057c5355b5b2456ee4749e39ffbf19191d1babe41012334b3", "logs": [], - "blockNumber": 27521439, - "cumulativeGasUsed": "1649212", + "blockNumber": 38734656, + "cumulativeGasUsed": "2381042", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/avalanche/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/avalanche/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/avalanche/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/base-goerli-testnet/AccessControlRegistry.json b/deployments/base-goerli-testnet/AccessControlRegistry.json index c9e1d954..9dbebbf2 100644 --- a/deployments/base-goerli-testnet/AccessControlRegistry.json +++ b/deployments/base-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x5ae4ad6b6621600e2315df395908d97c78d258eb80b6f89292a17669ba6692c4", + "transactionHash": "0x933f665e9425f9fad6ac0b983d10937aa82150fb8f41d3c4c0f1aeb00c5664b6", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1720828", + "transactionIndex": 1, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfb74442983dd4acae2b8cc3d6591af6b8ed18f4000e08b4502bf4d43080f873c", - "transactionHash": "0x5ae4ad6b6621600e2315df395908d97c78d258eb80b6f89292a17669ba6692c4", + "blockHash": "0xa292079fbd1d0e1e3d08475c83d7138aebf34d67896a3b2fdb5daf94954e7cc3", + "transactionHash": "0x933f665e9425f9fad6ac0b983d10937aa82150fb8f41d3c4c0f1aeb00c5664b6", "logs": [], - "blockNumber": 7032985, - "confirmations": 1510, - "cumulativeGasUsed": "2013636", - "effectiveGasPrice": "1500000001", + "blockNumber": 13379012, + "cumulativeGasUsed": "1112491", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/base-goerli-testnet/Api3ServerV1.json b/deployments/base-goerli-testnet/Api3ServerV1.json index 716ea30d..2361ce37 100644 --- a/deployments/base-goerli-testnet/Api3ServerV1.json +++ b/deployments/base-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xa74b6be2c95de67c0561d284aabbf75780f1b79d12ecf3d3cd01babef34f0cf1", + "transactionHash": "0xeb1e88c7fd681e4ce308f638643f09b804ea6391bcc9d7c4f118bc11dac11503", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "2960756", + "transactionIndex": 1, + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf3bc2f0f7b2cd8ec4edeada9d97609c76aee2843fd4d60b80c0cd352c54fcbf3", - "transactionHash": "0xa74b6be2c95de67c0561d284aabbf75780f1b79d12ecf3d3cd01babef34f0cf1", + "blockHash": "0xac3fbe32beddbe4a56dd788ced01447339044dfcfcae3585e4f38b5065e929ec", + "transactionHash": "0xeb1e88c7fd681e4ce308f638643f09b804ea6391bcc9d7c4f118bc11dac11503", "logs": [], - "blockNumber": 7033024, - "cumulativeGasUsed": "3209309", + "blockNumber": 13379149, + "cumulativeGasUsed": "3008579", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/base-goerli-testnet/ProxyFactory.json b/deployments/base-goerli-testnet/ProxyFactory.json index 5f5ceffc..ac6c9930 100644 --- a/deployments/base-goerli-testnet/ProxyFactory.json +++ b/deployments/base-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x7e7a37ad0348f612b64eab37af2ccc09fb36c3069ecacf3df8e98617a1f2e0ce", + "transactionHash": "0x172569d7c5952210f6d3231a32b59709c2d57f06f6ca1629a8b95fc154077012", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 2, - "gasUsed": "1472737", + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5fdcaf74d79a34e638c8aacbd438d4a4de2a280ded7abf773501e7032b1ae323", - "transactionHash": "0x7e7a37ad0348f612b64eab37af2ccc09fb36c3069ecacf3df8e98617a1f2e0ce", + "blockHash": "0x635e823fc98b7a042446f846e22c1d73bac5faa3e0ce84e7295dcea64d31bafa", + "transactionHash": "0x172569d7c5952210f6d3231a32b59709c2d57f06f6ca1629a8b95fc154077012", "logs": [], - "blockNumber": 7033027, - "cumulativeGasUsed": "1913624", + "blockNumber": 13379153, + "cumulativeGasUsed": "2254776", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/base-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/base-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/base-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/base/AccessControlRegistry.json b/deployments/base/AccessControlRegistry.json index 0c2e4a3e..c2b727fb 100644 --- a/deployments/base/AccessControlRegistry.json +++ b/deployments/base/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xf6639ae2421332136bdfe3ad874810635b6cd82d7b0fec78c4ccb02af2dc0097", + "transactionHash": "0x37fbb311199d00baddfa0ad729d095f780c1a83d542210458d1c4c5dc2383206", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 9, - "gasUsed": "1720828", + "transactionIndex": 2, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd9c8bb22aecc7b77b4452712f76aeae5d18ef3f0a35e822868e3b913a2348e6a", - "transactionHash": "0xf6639ae2421332136bdfe3ad874810635b6cd82d7b0fec78c4ccb02af2dc0097", + "blockHash": "0x1a40c01d561914fa3cd540ba1eeb58989e5a1bd36653759b62e60a015a81966d", + "transactionHash": "0x37fbb311199d00baddfa0ad729d095f780c1a83d542210458d1c4c5dc2383206", "logs": [], - "blockNumber": 3920511, - "cumulativeGasUsed": "2746029", + "blockNumber": 7580792, + "cumulativeGasUsed": "1430857", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/base/Api3ServerV1.json b/deployments/base/Api3ServerV1.json index 104808ad..ba6045be 100644 --- a/deployments/base/Api3ServerV1.json +++ b/deployments/base/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x27232026bd6287051c16f526c7b37dd742001971323ccaca1d253c565bcc61cb", + "transactionHash": "0x059b56f0818b77339c0ad24ec3b8b5a61a75e96d1def8b52eb6ebbbf997e4931", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 9, + "transactionIndex": 5, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xae8ba3121f01791bf9f92a5b4c0fcc25ae7f3659aa87d5debad25c2f8d071097", - "transactionHash": "0x27232026bd6287051c16f526c7b37dd742001971323ccaca1d253c565bcc61cb", + "blockHash": "0x85786e67e09bec06a25c817569aeef06ebefcb15ef27cdc54e65e546ac37277d", + "transactionHash": "0x059b56f0818b77339c0ad24ec3b8b5a61a75e96d1def8b52eb6ebbbf997e4931", "logs": [], - "blockNumber": 3920538, - "cumulativeGasUsed": "4090550", + "blockNumber": 7580796, + "cumulativeGasUsed": "3257983", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/base/OrderPayable.json b/deployments/base/OrderPayable.json index fbec34cc..a26cd96a 100644 --- a/deployments/base/OrderPayable.json +++ b/deployments/base/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x248b802d6d9b7f3191f4a8b7f97b34ec2d816641335fb447fd4c962ea82ac346", + "transactionHash": "0x8bd8df79bb74eff372cc075f4ab939e2758c4ade2c4bc899e05bd9d990c471b5", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 9, + "transactionIndex": 1, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2598712a17d8ae82531ee057056aba98e74001f9f517fff679dfbdf108cfe8b7", - "transactionHash": "0x248b802d6d9b7f3191f4a8b7f97b34ec2d816641335fb447fd4c962ea82ac346", + "blockHash": "0xa730d71452b6ac1b66808bbfde412dd66318ca2c80b38f20fccf7f5645ef05bb", + "transactionHash": "0x8bd8df79bb74eff372cc075f4ab939e2758c4ade2c4bc899e05bd9d990c471b5", "logs": [], - "blockNumber": 3920600, - "cumulativeGasUsed": "1972774", + "blockNumber": 7586583, + "cumulativeGasUsed": "1281896", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17535, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/base/ProxyFactory.json b/deployments/base/ProxyFactory.json index 66e0b42e..d841dc92 100644 --- a/deployments/base/ProxyFactory.json +++ b/deployments/base/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x7b8fc202c30e03ebd1004d2198550ed9fad638fae710c17f23526d69d3da764c", + "transactionHash": "0x5f2861fd844e81a4a824beaee9bd5c60bb9ddfe2d49b00d99fc72b150a50b5fe", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 4, + "transactionIndex": 3, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x59ab0d6d3abf310ccda38757ea6a14092d6729342d9ce91924e8397225f55ab0", - "transactionHash": "0x7b8fc202c30e03ebd1004d2198550ed9fad638fae710c17f23526d69d3da764c", + "blockHash": "0x53e9dc15c97db1be8e45d200d0e9c333b8ff209bf901252c0c14ab0b7d805001", + "transactionHash": "0x5f2861fd844e81a4a824beaee9bd5c60bb9ddfe2d49b00d99fc72b150a50b5fe", "logs": [], - "blockNumber": 3920550, - "cumulativeGasUsed": "2350983", + "blockNumber": 7580798, + "cumulativeGasUsed": "1814264", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/base/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/base/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/base/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/bsc-testnet/AccessControlRegistry.json b/deployments/bsc-testnet/AccessControlRegistry.json index 8b7d3975..c1072491 100644 --- a/deployments/bsc-testnet/AccessControlRegistry.json +++ b/deployments/bsc-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x54289781042360d03d38906b1b84ce470ebdf3e7d3e1ad6c9446d265ad6584e3", + "transactionHash": "0x10828ef385b8deb63ea25f9ae7decc8b8d2c1383fcb7c67e66a60d177127c229", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 6, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, + "transactionIndex": 1, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0b56aca62f032bbad13f8696651274dcee3e97d9bb31624dde55bf152976f006", - "transactionHash": "0x54289781042360d03d38906b1b84ce470ebdf3e7d3e1ad6c9446d265ad6584e3", + "blockHash": "0xd4477367c2bbcf157b348aaeba51a076c9308d3272fd807a0af3508e79d0a872", + "transactionHash": "0x10828ef385b8deb63ea25f9ae7decc8b8d2c1383fcb7c67e66a60d177127c229", "logs": [], - "blockNumber": 28030869, - "confirmations": 381690, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1caca1" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x02540be400" }, + "blockNumber": 35747910, + "cumulativeGasUsed": "1358008", "status": 1, - "type": 0, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/bsc-testnet/Api3ServerV1.json b/deployments/bsc-testnet/Api3ServerV1.json index 88ded1c2..42c67b04 100644 --- a/deployments/bsc-testnet/Api3ServerV1.json +++ b/deployments/bsc-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x9fcd36f579b17e3db9fe952e79fab04f8d515b6b4b37df874aabe48310588218", + "transactionHash": "0xb608547015e2fe71a9058ea9e76bd8d7eb767a9b3fd791877f57d01917fc2b69", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 4, - "gasUsed": "2959456", + "transactionIndex": 3, + "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd88a5e6d5ff8d5f74f31be624bc3326051b2f944112af2bfb5928b6dc34e644c", - "transactionHash": "0x9fcd36f579b17e3db9fe952e79fab04f8d515b6b4b37df874aabe48310588218", + "blockHash": "0x23b21377e89385a4aa4d73c745cf580f747b2b7b854a2df4b5430d66a878fe1d", + "transactionHash": "0xb608547015e2fe71a9058ea9e76bd8d7eb767a9b3fd791877f57d01917fc2b69", "logs": [], - "blockNumber": 28099298, - "cumulativeGasUsed": "3215968", + "blockNumber": 35747913, + "cumulativeGasUsed": "3963627", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/bsc-testnet/ProxyFactory.json b/deployments/bsc-testnet/ProxyFactory.json index 7e3ee7f0..a8d16bbd 100644 --- a/deployments/bsc-testnet/ProxyFactory.json +++ b/deployments/bsc-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xbe28716ca444cbfad2ae7bb20cb64ec31d4691831a132937b16a533363df247c", + "transactionHash": "0x016321c3ac0b1b409aaf21196f973bc256e8800791f191b2ccbb18ae4ebb40c6", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, + "transactionIndex": 2, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe680093d20d52b4971d60e2278161e179899e86089ed0e966afb9e2a198d60e9", - "transactionHash": "0xbe28716ca444cbfad2ae7bb20cb64ec31d4691831a132937b16a533363df247c", + "blockHash": "0x363f8897389abccd0e469d528375091448bdc5655e9449cbba4955e1b780a510", + "transactionHash": "0x016321c3ac0b1b409aaf21196f973bc256e8800791f191b2ccbb18ae4ebb40c6", "logs": [], - "blockNumber": 28099301, - "cumulativeGasUsed": "1535737", + "blockNumber": 35747915, + "cumulativeGasUsed": "1642355", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/bsc-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/bsc-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/bsc-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/bsc/AccessControlRegistry.json b/deployments/bsc/AccessControlRegistry.json index 35713021..90663b94 100644 --- a/deployments/bsc/AccessControlRegistry.json +++ b/deployments/bsc/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x6912b36860039a19a80fb33d95340f86e37bc7d6b0d377e1f1a1c1bf09091381", + "transactionHash": "0x1bfe7b8a38cc9d03ac5ce1d7a1f9640c630141ef72adfa028d9cda277a7d6de7", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 53, - "gasUsed": "1720828", + "transactionIndex": 80, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1dbadefe6ba592973889d62c606d240bb8635e4f232163eac8e21db3b2624868", - "transactionHash": "0x6912b36860039a19a80fb33d95340f86e37bc7d6b0d377e1f1a1c1bf09091381", + "blockHash": "0xa35d4e64e19c0f0db6e444383433aa2c8e52da4862a37b47d9e3ebf1673899ec", + "transactionHash": "0x1bfe7b8a38cc9d03ac5ce1d7a1f9640c630141ef72adfa028d9cda277a7d6de7", "logs": [], - "blockNumber": 26520949, - "cumulativeGasUsed": "6107863", + "blockNumber": 34145921, + "cumulativeGasUsed": "7135611", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/bsc/Api3ServerV1.json b/deployments/bsc/Api3ServerV1.json index 421acd6b..f8cc3876 100644 --- a/deployments/bsc/Api3ServerV1.json +++ b/deployments/bsc/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x4a5ccc5fd70651ed7e6b9dbf565ad39e6f36d507c03fb2f113164fe484e4c592", + "transactionHash": "0xbe3f5b0dc18d46a3fbeeb7c069ae7eae168eb42e2fb39086614abac92741a642", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 52, - "gasUsed": "2959456", + "transactionIndex": 48, + "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0c39cb2382d1b90b05c8fa49f390464bf2797ea50988621d2f95d99db321e171", - "transactionHash": "0x4a5ccc5fd70651ed7e6b9dbf565ad39e6f36d507c03fb2f113164fe484e4c592", + "blockHash": "0x1b50e92bf5fb685f07d7adc61142fbf90066d36f40af9855a300a82eafef1ceb", + "transactionHash": "0xbe3f5b0dc18d46a3fbeeb7c069ae7eae168eb42e2fb39086614abac92741a642", "logs": [], - "blockNumber": 26520957, - "cumulativeGasUsed": "8199351", + "blockNumber": 34145925, + "cumulativeGasUsed": "7644790", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/bsc/OrderPayable.json b/deployments/bsc/OrderPayable.json index f7a0f993..a5f8b009 100644 --- a/deployments/bsc/OrderPayable.json +++ b/deployments/bsc/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x3d82543d5566dabb6a6095190fc2b08109922ba36ce20346e1e9e552b4edc965", + "transactionHash": "0xe621a2dd6479047959f12c00732bf1be8614e0731cf665791301a9e853e92572", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 122, - "gasUsed": "1231583", + "transactionIndex": 196, + "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x526fc6091d346049008a2875ca25329ae82a20fceb8711e8c9a051469bc9f9dc", - "transactionHash": "0x3d82543d5566dabb6a6095190fc2b08109922ba36ce20346e1e9e552b4edc965", + "blockHash": "0x01082a3f21e71b8b90093f8cc666eb18e61bd6a4a614386ffd71ae06809b4d08", + "transactionHash": "0xe621a2dd6479047959f12c00732bf1be8614e0731cf665791301a9e853e92572", "logs": [], - "blockNumber": 28515860, - "cumulativeGasUsed": "11525642", + "blockNumber": 34149312, + "cumulativeGasUsed": "11418554", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/bsc/ProxyFactory.json b/deployments/bsc/ProxyFactory.json index b740a92c..125d0c4c 100644 --- a/deployments/bsc/ProxyFactory.json +++ b/deployments/bsc/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xc1b7bf51c52952041078f73b99040e04d6863a2a91887b4f30435499b058cb8f", + "transactionHash": "0xc5c6cff7e1d361ce1f2099fe3bcd866753fb7dcbf78ed377394d63306b1c4466", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 57, + "transactionIndex": 107, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x024ce935e898ffc27e0e616c76c4ca43dffd9af13716e05e941b11da4c539400", - "transactionHash": "0xc1b7bf51c52952041078f73b99040e04d6863a2a91887b4f30435499b058cb8f", + "blockHash": "0x8eee512f89a900c74a1c87b2eba1bcdbfcd10b6cdf1aef1fdab332f48436f5f6", + "transactionHash": "0xc5c6cff7e1d361ce1f2099fe3bcd866753fb7dcbf78ed377394d63306b1c4466", "logs": [], - "blockNumber": 26520960, - "cumulativeGasUsed": "6099699", + "blockNumber": 34145927, + "cumulativeGasUsed": "9474624", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/bsc/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/bsc/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/bsc/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/cronos-testnet/AccessControlRegistry.json b/deployments/cronos-testnet/AccessControlRegistry.json index b34b4ee4..01153e27 100644 --- a/deployments/cronos-testnet/AccessControlRegistry.json +++ b/deployments/cronos-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", + "address": "0x8984152339F9D35742BB878D0eaD9EF9fd6469d3", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x80a3f1b05db2be2ea95f8ecf8ea733be5daa950bb72e78afc0d4e3d46066eb71", + "transactionHash": "0x2d8412c54640a2d3e2450812fbfcbedcc79cae740a9dad960651a5ea623a1a3b", "receipt": { "to": null, "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", - "transactionIndex": 0, - "gasUsed": "1717458", + "contractAddress": "0x8984152339F9D35742BB878D0eaD9EF9fd6469d3", + "transactionIndex": 1, + "gasUsed": "1059691", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x70383e03d62fa457ceba65fff3117b16bc4a48e8890328fe1f6a315623ca99ca", - "transactionHash": "0x80a3f1b05db2be2ea95f8ecf8ea733be5daa950bb72e78afc0d4e3d46066eb71", + "blockHash": "0x6a0ef587ba44667b3b9e9e79d9e90ecfb739598bb39b0ad5e909074702b5bd94", + "transactionHash": "0x2d8412c54640a2d3e2450812fbfcbedcc79cae740a9dad960651a5ea623a1a3b", "logs": [], - "blockNumber": 10869757, - "cumulativeGasUsed": "1717458", + "blockNumber": 16023265, + "cumulativeGasUsed": "1581677", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/cronos-testnet/Api3ServerV1.json b/deployments/cronos-testnet/Api3ServerV1.json index d7a018cc..b6cd9eca 100644 --- a/deployments/cronos-testnet/Api3ServerV1.json +++ b/deployments/cronos-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", + "address": "0x33E6C2f5Fa6aA18254927F55b0C5b5B975Ec1358", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x133f716df168651e4df03fd4060ee707d38348de01edc936f56ae8ab19d04c10", + "transactionHash": "0xe1bd43f27eef9e19ed2b39f584f99fd64f71c7780cbd0e6a190efcd5614d65ca", "receipt": { "to": null, "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", + "contractAddress": "0x33E6C2f5Fa6aA18254927F55b0C5b5B975Ec1358", "transactionIndex": 0, "gasUsed": "2954518", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x845dfbd6c23dbbc0ddbd11a13550d9a92edf6cff3f4051fc1693e0b74d906904", - "transactionHash": "0x133f716df168651e4df03fd4060ee707d38348de01edc936f56ae8ab19d04c10", + "blockHash": "0xc44db3d3e8d9e025d0ce9f3d9ec6bb0833578570fede1bf0486ffbf079c5677e", + "transactionHash": "0xe1bd43f27eef9e19ed2b39f584f99fd64f71c7780cbd0e6a190efcd5614d65ca", "logs": [], - "blockNumber": 10869768, + "blockNumber": 16023267, "cumulativeGasUsed": "2954518", "status": 1, "byzantium": true }, "args": [ - "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", + "0x8984152339F9D35742BB878D0eaD9EF9fd6469d3", "Api3ServerV1 admin", "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/cronos-testnet/ProxyFactory.json b/deployments/cronos-testnet/ProxyFactory.json index 23a32223..6a9043e5 100644 --- a/deployments/cronos-testnet/ProxyFactory.json +++ b/deployments/cronos-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", + "address": "0xC3E76D8829259f2A34541746de2F8A0509Dc1987", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x35c729d82ff5a7d6003ad57e53ed56488c451872763a22f4aab444fe2b64ac04", + "transactionHash": "0x47cef5467c565e1091da2d335de7a8d2ccaa1f620676c3cdfb9a6d6fc1da8e8e", "receipt": { "to": null, "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", + "contractAddress": "0xC3E76D8829259f2A34541746de2F8A0509Dc1987", "transactionIndex": 0, "gasUsed": "1469833", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc53701c9a59eed138fcb3a6e5fff890a46f72ce2afbf24a7a55701cd912e19e9", - "transactionHash": "0x35c729d82ff5a7d6003ad57e53ed56488c451872763a22f4aab444fe2b64ac04", + "blockHash": "0xd0c184146047d77f7c980e6a411ca702fb89cd8752018d4acdd04852ceda475b", + "transactionHash": "0x47cef5467c565e1091da2d335de7a8d2ccaa1f620676c3cdfb9a6d6fc1da8e8e", "logs": [], - "blockNumber": 10869770, + "blockNumber": 16023270, "cumulativeGasUsed": "1469833", "status": 1, "byzantium": true }, - "args": ["0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286"], + "args": ["0x33E6C2f5Fa6aA18254927F55b0C5b5B975Ec1358"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/cronos-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/cronos-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/cronos-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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 b47a223a..72b641f7 100644 --- a/deployments/deployment-block-numbers.json +++ b/deployments/deployment-block-numbers.json @@ -10,18 +10,13 @@ "100": "gnosis", "137": "polygon", "250": "fantom", - "280": "zksync-goerli-testnet", - "324": "zksync", "338": "cronos-testnet", "420": "optimism-goerli-testnet", - "599": "metis-goerli-testnet", - "1088": "metis", "1101": "polygon-zkevm", "1284": "moonbeam", "1285": "moonriver", "1287": "moonbeam-testnet", "1442": "polygon-zkevm-goerli-testnet", - "2001": "milkomeda-c1", "2221": "kava-testnet", "2222": "kava", "4002": "fantom-testnet", @@ -36,52 +31,45 @@ "59144": "linea", "80001": "polygon-testnet", "84531": "base-goerli-testnet", - "200101": "milkomeda-c1-testnet", "421613": "arbitrum-goerli-testnet", "534353": "scroll-goerli-testnet", "11155111": "ethereum-sepolia-testnet" }, "AccessControlRegistry": { - "1": 16841997, - "5": 8652496, - "10": 81462343, - "30": 5136160, - "31": 3658426, - "56": 26520949, - "97": 28030869, - "100": 26975348, - "137": 40421502, - "250": 57720789, - "280": 3197308, - "324": 314819, - "338": 10869757, - "420": 6677891, - "599": 719583, - "1088": 5092413, - "1101": 313, - "1284": 3153181, - "1285": 3832937, - "1287": 3936958, - "1442": 147619, - "2001": 9654456, - "2221": 6232734, - "2222": 6465624, - "4002": 14501361, - "5000": 4272645, - "5001": 15355467, - "8453": 3920511, - "10200": 2918656, - "42161": 70478595, - "43113": 19832625, - "43114": 27521424, - "59140": 1121436, - "59144": 412566, - "80001": 33096183, - "84531": 7032985, - "200101": 10629063, - "421613": 11400046, - "534353": 3833207, - "11155111": 3087214 + "1": 18734505, + "5": 10173005, + "10": 113178117, + "30": 5878534, + "31": 4570400, + "56": 34145921, + "97": 35747910, + "100": 31307049, + "137": 50813948, + "250": 72156335, + "338": 16023265, + "420": 18265214, + "1101": 8431018, + "1284": 5023316, + "1285": 5690345, + "1287": 5631525, + "1442": 3391430, + "2221": 8690193, + "2222": 7622817, + "4002": 22948049, + "5000": 25122378, + "5001": 26958881, + "8453": 7580792, + "10200": 7268394, + "42161": 157740807, + "43113": 28376781, + "43114": 38734650, + "59140": 2504514, + "59144": 1094473, + "80001": 43292190, + "84531": 13379012, + "421613": 58263197, + "534353": 5856670, + "11155111": 4840249 }, "OwnableCallForwarder": { "1": 16842004, @@ -94,23 +82,18 @@ "100": 26975349, "137": 40421552, "250": 57720793, - "280": 3197318, - "324": 314826, "338": 10869759, "420": 6677895, - "599": 719584, - "1088": 5092415, "1101": 314, "1284": 3153183, "1285": 3832939, "1287": 3936959, "1442": 147620, - "2001": 9654459, "2221": 6232736, "2222": 6465630, "4002": 14501364, "5000": 4272650, - "5001": 15355484, + "5001": 26958886, "8453": 3920522, "10200": 2918659, "42161": 70478619, @@ -120,127 +103,99 @@ "59144": 412567, "80001": 33096187, "84531": 7033014, - "200101": 10629065, "421613": 11400057, "534353": 3833210, "11155111": 3087218 }, "Api3ServerV1": { - "1": 16842021, - "5": 8665874, - "10": 81462409, - "30": 5136190, - "31": 3664679, - "56": 26520957, - "97": 28099298, - "100": 26975353, - "137": 40421857, - "250": 57720802, - "280": 3197340, - "324": 314845, - "338": 10869768, - "420": 6779277, - "599": 719588, - "1088": 5092417, - "1101": 336, - "1284": 3153187, - "1285": 3832943, - "1287": 3951904, - "1442": 147622, - "2001": 9654464, - "2221": 6232739, - "2222": 6465657, - "4002": 14541214, - "5000": 4272670, - "5001": 15355491, - "8453": 3920538, - "10200": 2959487, - "42161": 70478684, - "43113": 19914010, - "43114": 27521435, - "59140": 1121439, - "59144": 412580, - "80001": 33191556, - "84531": 7033024, - "200101": 10680264, - "421613": 11748727, - "534353": 3833217, - "11155111": 3103453 + "1": 18734506, + "5": 10173007, + "10": 113178121, + "30": 5878540, + "31": 4570402, + "56": 34145925, + "97": 35747913, + "100": 31307055, + "137": 50814053, + "250": 72156341, + "338": 16023267, + "420": 18265217, + "1101": 8431019, + "1284": 5023318, + "1285": 5690347, + "1287": 5631550, + "1442": 3391432, + "2221": 8690194, + "2222": 7622819, + "4002": 22948050, + "5000": 25122385, + "5001": 26958896, + "8453": 7580796, + "10200": 7268975, + "42161": 157740828, + "43113": 28376782, + "43114": 38734652, + "59140": 2504859, + "59144": 1094475, + "80001": 43292193, + "84531": 13379149, + "421613": 58263206, + "534353": 5856671, + "11155111": 4840540 }, "ProxyFactory": { - "1": 16842033, - "5": 8665875, - "10": 81462433, - "30": 5136194, - "31": 3664681, - "56": 26520960, - "97": 28099301, - "100": 26975354, - "137": 40421901, - "250": 57720808, - "280": 3384648, - "324": 520324, - "338": 10869770, - "420": 6779283, - "599": 719590, - "1088": 5092418, - "1101": 337, - "1284": 3153189, - "1285": 3832945, - "1287": 3951906, - "1442": 147624, - "2001": 9654466, - "2221": 6232741, - "2222": 6465659, - "4002": 14541216, - "5000": 4272677, - "5001": 15355507, - "8453": 3920550, - "10200": 2959489, - "42161": 70478707, - "43113": 19914013, - "43114": 27521439, - "59140": 1121440, - "59144": 412581, - "80001": 33191560, - "84531": 7033027, - "200101": 10680266, - "421613": 11748733, - "534353": 3833220, - "11155111": 3103454 - }, - "MockErc20PermitToken": { - "5": 9177620, - "80001": 36840089 - }, - "PrepaymentDepository": { - "1": 17173868, - "5": 9177621, - "80001": 36840093 + "1": 18734507, + "5": 10173008, + "10": 113178125, + "30": 5878561, + "31": 4570404, + "56": 34145927, + "97": 35747915, + "100": 31307058, + "137": 50814057, + "250": 72156345, + "338": 16023270, + "420": 18265220, + "1101": 8431020, + "1284": 5023320, + "1285": 5690349, + "1287": 5631552, + "1442": 3391434, + "2221": 8690196, + "2222": 7622822, + "4002": 22948052, + "5000": 25122393, + "5001": 26958899, + "8453": 7580798, + "10200": 7268976, + "42161": 157740846, + "43113": 28376785, + "43114": 38734656, + "59140": 2505015, + "59144": 1094477, + "80001": 43292197, + "84531": 13379153, + "421613": 58263211, + "534353": 5856672, + "11155111": 4840541 }, "OrderPayable": { - "1": 17335203, - "5": 9138535, - "10": 101351571, - "30": 5637195, - "56": 28515860, - "100": 28119552, - "137": 43125869, - "250": 63041207, - "1101": 407886, - "1284": 3636977, - "1285": 4314286, - "2222": 6465680, - "5000": 4272681, - "8453": 3920600, - "42161": 94242635, - "43114": 30469801, - "59144": 412590, - "11155111": 3642159 + "1": 18735287, + "10": 113182284, + "30": 5878838, + "56": 34149312, + "100": 31323833, + "137": 50855002, + "250": 72165955, + "1101": 8448066, + "1284": 5030520, + "1285": 5690996, + "2222": 7636630, + "5000": 25400815, + "8453": 7586583, + "42161": 157788064, + "43114": 38740595, + "59144": 1109154 }, - "RequesterAuthorizerWithErc721": { - "1": 17272385, - "5": 9010094, - "11155111": 3594739 - } + "RequesterAuthorizerWithErc721": {} } diff --git a/deployments/ethereum-goerli-testnet/AccessControlRegistry.json b/deployments/ethereum-goerli-testnet/AccessControlRegistry.json index 64c3e9d2..33121034 100644 --- a/deployments/ethereum-goerli-testnet/AccessControlRegistry.json +++ b/deployments/ethereum-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0xc6f1e700d6296cd2b90006b99655797bcc90faeaa450d6981be11658e323cf33", + "transactionHash": "0x657e7aa4ff6b43199e506600d4850e4359e4dafba7ddea95109c864f60a70a0d", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 103, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, + "transactionIndex": 50, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x60d5b64c2b0eeb0113aa2f757784e4e6007625e98d7273b25f577429066a196b", - "transactionHash": "0xc6f1e700d6296cd2b90006b99655797bcc90faeaa450d6981be11658e323cf33", + "blockHash": "0x698df91e1ac1147e3c02c111370081556992876870e176885b594365dcff9b51", + "transactionHash": "0x657e7aa4ff6b43199e506600d4850e4359e4dafba7ddea95109c864f60a70a0d", "logs": [], - "blockNumber": 8652496, - "confirmations": 75038, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0xa77f90" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x2bee0cd718" }, + "blockNumber": 10173005, + "cumulativeGasUsed": "9237096", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/ethereum-goerli-testnet/Api3ServerV1.json b/deployments/ethereum-goerli-testnet/Api3ServerV1.json index ea97164a..ca2a7dce 100644 --- a/deployments/ethereum-goerli-testnet/Api3ServerV1.json +++ b/deployments/ethereum-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xb2ca1ebbb61ae43f892f6e4486fc15e93c292a2f16ce862f5a13d8405b0814cd", + "transactionHash": "0xf2d45b94a7c252197d3a63ee09bbd1beec6266af358cb0c1c4468ada4e4e0157", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 85, + "transactionIndex": 36, "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0eb5a1c536ca2fe59243cc6c38674107362dead85098cfa096e2d1eb55da6340", - "transactionHash": "0xb2ca1ebbb61ae43f892f6e4486fc15e93c292a2f16ce862f5a13d8405b0814cd", + "blockHash": "0x9e4109d7eef069856243f7a7270613892247a8064f1c61496e8432e4d869818e", + "transactionHash": "0xf2d45b94a7c252197d3a63ee09bbd1beec6266af358cb0c1c4468ada4e4e0157", "logs": [], - "blockNumber": 8665874, - "cumulativeGasUsed": "11552372", + "blockNumber": 10173007, + "cumulativeGasUsed": "11618667", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/ethereum-goerli-testnet/MockErc20PermitToken.json b/deployments/ethereum-goerli-testnet/MockErc20PermitToken.json deleted file mode 100644 index 611c46c0..00000000 --- a/deployments/ethereum-goerli-testnet/MockErc20PermitToken.json +++ /dev/null @@ -1,569 +0,0 @@ -{ - "address": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd8bd33cb2fe8745dca3e95b2e10a1930258b469b0e8163c98b388adc5b5d9a6b", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 16, - "gasUsed": "1035750", - "logsBloom": "0x00000080000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000008000000000000000000000000000000000008000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000010000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x46a189711b2ba02a0db74067782948af0eba69dcc5da6630edea2904f6b302b2", - "transactionHash": "0xd8bd33cb2fe8745dca3e95b2e10a1930258b469b0e8163c98b388adc5b5d9a6b", - "logs": [ - { - "transactionIndex": 16, - "blockNumber": 9177620, - "transactionHash": "0xd8bd33cb2fe8745dca3e95b2e10a1930258b469b0e8163c98b388adc5b5d9a6b", - "address": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x00000000000000000000000000000000000000000000000000038d7ea4c68000", - "logIndex": 349, - "blockHash": "0x46a189711b2ba02a0db74067782948af0eba69dcc5da6630edea2904f6b302b2" - } - ], - "blockNumber": 9177620, - "cumulativeGasUsed": "3918112", - "status": 1, - "byzantium": true - }, - "args": ["0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1"], - "numDeployments": 3, - "solcInputHash": "6e649498aa892726038a27e6a3d82557", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/mock/MockErc20PermitToken.sol\":\"MockErc20PermitToken\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"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/Counters.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary Counters {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0xf0018c2440fbe238dd3a8732fa8e17a0f9dce84d31451dc8a32f6d62b349c9f1\",\"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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/utils/mock/MockErc20PermitToken.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Counters.sol\\\";\\n\\n// It is not possible to override the EIP712 version of\\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\\n// so it is copy-pasted below with the version \\\"2\\\" to imitate USDC\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n */\\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\\n using Counters for Counters.Counter;\\n\\n mapping(address => Counters.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n );\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n constructor(string memory name) EIP712(name, \\\"2\\\") {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(\\n abi.encode(\\n _PERMIT_TYPEHASH,\\n owner,\\n spender,\\n value,\\n _useNonce(owner),\\n deadline\\n )\\n );\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSA.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(\\n address owner\\n ) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(\\n address owner\\n ) internal virtual returns (uint256 current) {\\n Counters.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n}\\n\\ncontract MockErc20PermitToken is ERC20Permit {\\n constructor(address recipient) ERC20(\\\"Token\\\", \\\"TKN\\\") ERC20Permit(\\\"Token\\\") {\\n _mint(recipient, 1e9 * 10 ** decimals());\\n }\\n\\n function decimals() public view virtual override returns (uint8) {\\n return 6;\\n }\\n}\\n\",\"keccak256\":\"0x414616c15ded0a9d45a35f9f793fd3271677b3a86ef3657e720c33793c9865af\",\"license\":\"UNLICENSED\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b506040516200155e3803806200155e833981016040819052620000359162000257565b604051806040016040528060058152602001642a37b5b2b760d91b81525080604051806040016040528060018152602001601960f91b815250604051806040016040528060058152602001642a37b5b2b760d91b815250604051806040016040528060038152602001622a25a760e91b8152508160039081620000b991906200032d565b506004620000c882826200032d565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c0948501909152815191909601209052929092526101205250620001859050816200016f6006600a6200050e565b6200017f90633b9aca006200051f565b6200018c565b506200054f565b6001600160a01b038216620001e75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620001fb919062000539565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b6000602082840312156200026a57600080fd5b81516001600160a01b03811681146200028257600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002b457607f821691505b602082108103620002d557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200025257600081815260208120601f850160051c81016020861015620003045750805b601f850160051c820191505b81811015620003255782815560010162000310565b505050505050565b81516001600160401b0381111562000349576200034962000289565b62000361816200035a84546200029f565b84620002db565b602080601f831160018114620003995760008415620003805750858301515b600019600386901b1c1916600185901b17855562000325565b600085815260208120601f198616915b82811015620003ca57888601518255948401946001909101908401620003a9565b5085821015620003e95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000450578160001904821115620004345762000434620003f9565b808516156200044257918102915b93841c939080029062000414565b509250929050565b600082620004695750600162000508565b81620004785750600062000508565b81600181146200049157600281146200049c57620004bc565b600191505062000508565b60ff841115620004b057620004b0620003f9565b50506001821b62000508565b5060208310610133831016604e8410600b8410161715620004e1575081810a62000508565b620004ed83836200040f565b8060001904821115620005045762000504620003f9565b0290505b92915050565b60006200028260ff84168362000458565b8082028115828204841417620005085762000508620003f9565b80820180821115620005085762000508620003f9565b60805160a05160c05160e0516101005161012051610fbf6200059f6000396000610a0401526000610a5301526000610a2e01526000610987015260006109b1015260006109db0152610fbf6000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d7146101c3578063a9059cbb146101d6578063d505accf146101e9578063dd62ed3e146101fe57600080fd5b806370a082311461017f5780637ecebe00146101a857806395d89b41146101bb57600080fd5b806323b872dd116100c857806323b872dd14610142578063313ce567146101555780633644e51514610164578063395093511461016c57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f7610237565b6040516101049190610d86565b60405180910390f35b61012061011b366004610df0565b6102c9565b6040519015158152602001610104565b6002545b604051908152602001610104565b610120610150366004610e1a565b6102e3565b60405160068152602001610104565b610134610307565b61012061017a366004610df0565b610316565b61013461018d366004610e56565b6001600160a01b031660009081526020819052604090205490565b6101346101b6366004610e56565b610355565b6100f7610373565b6101206101d1366004610df0565b610382565b6101206101e4366004610df0565b610431565b6101fc6101f7366004610e78565b61043f565b005b61013461020c366004610eeb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461024690610f1e565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610f1e565b80156102bf5780601f10610294576101008083540402835291602001916102bf565b820191906000526020600020905b8154815290600101906020018083116102a257829003601f168201915b5050505050905090565b6000336102d78185856105a3565b60019150505b92915050565b6000336102f18582856106fb565b6102fc85858561078d565b506001949350505050565b600061031161097a565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102d79082908690610350908790610f52565b6105a3565b6001600160a01b0381166000908152600560205260408120546102dd565b60606004805461024690610f1e565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104245760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102fc82868684036105a3565b6000336102d781858561078d565b8342111561048f5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161041b565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886104be8c610aa1565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061051982610ac9565b9050600061052982878787610b32565b9050896001600160a01b0316816001600160a01b03161461058c5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161041b565b6105978a8a8a6105a3565b50505050505050505050565b6001600160a01b03831661061e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03821661069a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610787578181101561077a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161041b565b61078784848484036105a3565b50505050565b6001600160a01b0383166108095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0382166108855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b038316600090815260208190526040902054818110156109145760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610787565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156109d357507f000000000000000000000000000000000000000000000000000000000000000046145b156109fd57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b60006102dd610ad661097a565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610b4387878787610b5a565b91509150610b5081610c1e565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610b915750600090506003610c15565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610be5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c0e57600060019250925050610c15565b9150600090505b94509492505050565b6000816004811115610c3257610c32610f73565b03610c3a5750565b6001816004811115610c4e57610c4e610f73565b03610c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161041b565b6002816004811115610caf57610caf610f73565b03610cfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161041b565b6003816004811115610d1057610d10610f73565b03610d835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b50565b600060208083528351808285015260005b81811015610db357858101830151858201604001528201610d97565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610deb57600080fd5b919050565b60008060408385031215610e0357600080fd5b610e0c83610dd4565b946020939093013593505050565b600080600060608486031215610e2f57600080fd5b610e3884610dd4565b9250610e4660208501610dd4565b9150604084013590509250925092565b600060208284031215610e6857600080fd5b610e7182610dd4565b9392505050565b600080600080600080600060e0888a031215610e9357600080fd5b610e9c88610dd4565b9650610eaa60208901610dd4565b95506040880135945060608801359350608088013560ff81168114610ece57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610efe57600080fd5b610f0783610dd4565b9150610f1560208401610dd4565b90509250929050565b600181811c90821680610f3257607f821691505b602082108103610ac357634e487b7160e01b600052602260045260246000fd5b808201808211156102dd57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ca24feed64215eac668240d648e7abcb08df77403e9d582f942fc9374e11585764736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d7146101c3578063a9059cbb146101d6578063d505accf146101e9578063dd62ed3e146101fe57600080fd5b806370a082311461017f5780637ecebe00146101a857806395d89b41146101bb57600080fd5b806323b872dd116100c857806323b872dd14610142578063313ce567146101555780633644e51514610164578063395093511461016c57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f7610237565b6040516101049190610d86565b60405180910390f35b61012061011b366004610df0565b6102c9565b6040519015158152602001610104565b6002545b604051908152602001610104565b610120610150366004610e1a565b6102e3565b60405160068152602001610104565b610134610307565b61012061017a366004610df0565b610316565b61013461018d366004610e56565b6001600160a01b031660009081526020819052604090205490565b6101346101b6366004610e56565b610355565b6100f7610373565b6101206101d1366004610df0565b610382565b6101206101e4366004610df0565b610431565b6101fc6101f7366004610e78565b61043f565b005b61013461020c366004610eeb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461024690610f1e565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610f1e565b80156102bf5780601f10610294576101008083540402835291602001916102bf565b820191906000526020600020905b8154815290600101906020018083116102a257829003601f168201915b5050505050905090565b6000336102d78185856105a3565b60019150505b92915050565b6000336102f18582856106fb565b6102fc85858561078d565b506001949350505050565b600061031161097a565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102d79082908690610350908790610f52565b6105a3565b6001600160a01b0381166000908152600560205260408120546102dd565b60606004805461024690610f1e565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104245760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102fc82868684036105a3565b6000336102d781858561078d565b8342111561048f5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161041b565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886104be8c610aa1565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061051982610ac9565b9050600061052982878787610b32565b9050896001600160a01b0316816001600160a01b03161461058c5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161041b565b6105978a8a8a6105a3565b50505050505050505050565b6001600160a01b03831661061e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03821661069a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610787578181101561077a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161041b565b61078784848484036105a3565b50505050565b6001600160a01b0383166108095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0382166108855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b038316600090815260208190526040902054818110156109145760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610787565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156109d357507f000000000000000000000000000000000000000000000000000000000000000046145b156109fd57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b60006102dd610ad661097a565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610b4387878787610b5a565b91509150610b5081610c1e565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610b915750600090506003610c15565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610be5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c0e57600060019250925050610c15565b9150600090505b94509492505050565b6000816004811115610c3257610c32610f73565b03610c3a5750565b6001816004811115610c4e57610c4e610f73565b03610c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161041b565b6002816004811115610caf57610caf610f73565b03610cfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161041b565b6003816004811115610d1057610d10610f73565b03610d835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b50565b600060208083528351808285015260005b81811015610db357858101830151858201604001528201610d97565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610deb57600080fd5b919050565b60008060408385031215610e0357600080fd5b610e0c83610dd4565b946020939093013593505050565b600080600060608486031215610e2f57600080fd5b610e3884610dd4565b9250610e4660208501610dd4565b9150604084013590509250925092565b600060208284031215610e6857600080fd5b610e7182610dd4565b9392505050565b600080600080600080600060e0888a031215610e9357600080fd5b610e9c88610dd4565b9650610eaa60208901610dd4565b95506040880135945060608801359350608088013560ff81168114610ece57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610efe57600080fd5b610f0783610dd4565b9150610f1560208401610dd4565b90509250929050565b600181811c90821680610f3257607f821691505b602082108103610ac357634e487b7160e01b600052602260045260246000fd5b808201808211156102dd57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ca24feed64215eac668240d648e7abcb08df77403e9d582f942fc9374e11585764736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "DOMAIN_SEPARATOR()": { - "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." - }, - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "nonces(address)": { - "details": "See {IERC20Permit-nonces}." - }, - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { - "details": "See {IERC20Permit-permit}." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 2399, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_nonces", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(Counter)753_storage)" - }, - { - "astId": 2407, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", - "offset": 0, - "slot": "6", - "type": "t_bytes32" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_struct(Counter)753_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Counters.Counter)", - "numberOfBytes": "32", - "value": "t_struct(Counter)753_storage" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Counter)753_storage": { - "encoding": "inplace", - "label": "struct Counters.Counter", - "members": [ - { - "astId": 752, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_value", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/deployments/ethereum-goerli-testnet/OrderPayable.json b/deployments/ethereum-goerli-testnet/OrderPayable.json index b9bae55d..49997ade 100644 --- a/deployments/ethereum-goerli-testnet/OrderPayable.json +++ b/deployments/ethereum-goerli-testnet/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x01469c589eb5ac7109c1b0415dac78714da0aa98c60059a2e142a4701491e895", + "transactionHash": "0x4cc72ecf05d4cb8abbf1d5e5bb6a6b29aa7ae08ade2d9aa5d112e8a90748a770", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 7, + "transactionIndex": 88, "gasUsed": "1235415", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x05c762326a28eb1379626fbdf05da3f9ad08ed61828a8d0cdb1e505d85a791e9", - "transactionHash": "0x01469c589eb5ac7109c1b0415dac78714da0aa98c60059a2e142a4701491e895", + "blockHash": "0x72a5bdb2ba319d84ac5d9e228a8d7323770adb2b6d92d2897b42a319696b2456", + "transactionHash": "0x4cc72ecf05d4cb8abbf1d5e5bb6a6b29aa7ae08ade2d9aa5d112e8a90748a770", "logs": [], - "blockNumber": 9138535, - "cumulativeGasUsed": "3025831", + "blockNumber": 10173018, + "cumulativeGasUsed": "28849551", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/ethereum-goerli-testnet/PrepaymentDepository.json b/deployments/ethereum-goerli-testnet/PrepaymentDepository.json deleted file mode 100644 index 15ba871a..00000000 --- a/deployments/ethereum-goerli-testnet/PrepaymentDepository.json +++ /dev/null @@ -1,967 +0,0 @@ -{ - "address": "0x7A175B0C798bDD6C0Ea10C9d82dcd40a05e0F672", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_accessControlRegistry", - "type": "address" - }, - { - "internalType": "string", - "name": "_adminRoleDescription", - "type": "string" - }, - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Claimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DecreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "IncreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "SetWithdrawalDestination", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "name": "Withdrew", - "type": "event" - }, - { - "inputs": [], - "name": "CLAIMER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WITHDRAWAL_SIGNER_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": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "applyPermitAndDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "decreaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "increaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "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": "user", - "type": "address" - }, - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "setWithdrawalDestination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalDestination", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitDecreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitIncreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "withdraw", - "outputs": [ - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalSignerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "withdrawalWithHashIsExecuted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x2e8ab5ee94e81a9eb4c3e8f0776520e62b13cf87f81bf4f4b339fa4d4d505ef7", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 23, - "gasUsed": "2040931", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb2beb970069dfe62c0031113ac5a4e0daea0880932fcda2edc474624f7f30a8d", - "transactionHash": "0x2e8ab5ee94e81a9eb4c3e8f0776520e62b13cf87f81bf4f4b339fa4d4d505ef7", - "logs": [], - "blockNumber": 9177621, - "cumulativeGasUsed": "9234805", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "PrepaymentDepository admin (OEV Relay)", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9" - ], - "numDeployments": 3, - "solcInputHash": "07bb4c0d5cdd8840a822dc1d7ed83326", - "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\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"DecreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"IncreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"SetWithdrawalDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLAIMER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_SIGNER_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\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"applyPermitAndDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"decreaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"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\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"setWithdrawalDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitDecreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitIncreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalSignerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"withdrawalWithHashIsExecuted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"deadline\":\"Deadline of the permit\",\"r\":\"r component of the signature\",\"s\":\"s component of the signature\",\"user\":\"User address\",\"v\":\"v component of the signature\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"claim(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to claim\",\"recipient\":\"Recipient address\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\",\"_token\":\"Contract address of the ERC20 token that prepayments are made in\"}},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"params\":{\"amount\":\"Amount to decrease the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Decreased withdrawal limit\"}},\"deposit(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"increaseUserWithdrawalLimit(address,uint256)\":{\"details\":\"This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls\",\"params\":{\"amount\":\"Amount to increase the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"setWithdrawalDestination(address,address)\":{\"params\":{\"user\":\"User address\",\"withdrawalDestination\":\"Withdrawal destination\"}},\"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(uint256,uint256,address,bytes)\":{\"params\":{\"amount\":\"Amount of tokens to withdraw\",\"expirationTimestamp\":\"Expiration timestamp of the signature\",\"signature\":\"Withdrawal signature\",\"withdrawalSigner\":\"Address of the account that signed the withdrawal\"},\"returns\":{\"withdrawalDestination\":\"Withdrawal destination\",\"withdrawalLimit\":\"Decreased withdrawal limit\"}}},\"title\":\"Contract that enables micropayments to be prepaid in batch\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"CLAIMER_ROLE_DESCRIPTION()\":{\"notice\":\"Claimer role description\"},\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit decreaser role description\"},\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit increaser role description\"},\"WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal signer role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"notice\":\"Called to apply a ERC2612 permit and deposit tokens on behalf of a user\"},\"claim(address,uint256)\":{\"notice\":\"Called to claim tokens\"},\"claimerRole()\":{\"notice\":\"Claimer role\"},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to decrease the withdrawal limit of the user\"},\"deposit(address,uint256)\":{\"notice\":\"Called to deposit tokens on behalf of a user\"},\"increaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to increase the withdrawal limit of the user\"},\"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\"},\"setWithdrawalDestination(address,address)\":{\"notice\":\"Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination\"},\"token()\":{\"notice\":\"Contract address of the ERC20 token that prepayments can be made in\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"userToWithdrawalDestination(address)\":{\"notice\":\"Returns the withdrawal destination of the user\"},\"userToWithdrawalLimit(address)\":{\"notice\":\"Returns the withdrawal limit of the user\"},\"userWithdrawalLimitDecreaserRole()\":{\"notice\":\"User withdrawal limit decreaser role\"},\"userWithdrawalLimitIncreaserRole()\":{\"notice\":\"User withdrawal limit increaser role\"},\"withdraw(uint256,uint256,address,bytes)\":{\"notice\":\"Called by a user to withdraw tokens\"},\"withdrawalSignerRole()\":{\"notice\":\"Withdrawal signer role\"},\"withdrawalWithHashIsExecuted(bytes32)\":{\"notice\":\"Returns if the withdrawal with the hash is executed\"}},\"notice\":\"`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/PrepaymentDepository.sol\":\"PrepaymentDepository\"},\"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/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/PrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./interfaces/IPrepaymentDepository.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\n/// @title Contract that enables micropayments to be prepaid in batch\\n/// @notice `manager` represents the payment recipient, and its various\\n/// privileges can be delegated to other accounts through respective roles.\\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\\n/// be granted to a multisig or an equivalently decentralized account.\\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\\n/// being compromised poses a risk in proportion to the redundancy in user\\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\\n/// withdrawal limits as necessary to mitigate this risk.\\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\\n/// cannot cause irreversible harm.\\n/// This contract accepts prepayments in an ERC20 token specified immutably\\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\\n/// An optional `depositWithPermit()` function is added to provide ERC2612\\n/// support.\\ncontract PrepaymentDepository is\\n AccessControlRegistryAdminnedWithManager,\\n IPrepaymentDepository\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Withdrawal signer role description\\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\\n \\\"Withdrawal signer\\\";\\n /// @notice User withdrawal limit increaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit increaser\\\";\\n /// @notice User withdrawal limit decreaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit decreaser\\\";\\n /// @notice Claimer role description\\n string public constant override CLAIMER_ROLE_DESCRIPTION = \\\"Claimer\\\";\\n\\n // We prefer revert strings over custom errors because not all chains and\\n // block explorers support custom errors\\n string private constant AMOUNT_ZERO_REVERT_STRING = \\\"Amount zero\\\";\\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\\n \\\"Amount exceeds limit\\\";\\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\\n \\\"Transfer unsuccessful\\\";\\n\\n /// @notice Withdrawal signer role\\n bytes32 public immutable override withdrawalSignerRole;\\n /// @notice User withdrawal limit increaser role\\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\\n /// @notice User withdrawal limit decreaser role\\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\\n /// @notice Claimer role\\n bytes32 public immutable override claimerRole;\\n\\n /// @notice Contract address of the ERC20 token that prepayments can be\\n /// made in\\n address public immutable override token;\\n\\n /// @notice Returns the withdrawal destination of the user\\n mapping(address => address) public userToWithdrawalDestination;\\n\\n /// @notice Returns the withdrawal limit of the user\\n mapping(address => uint256) public userToWithdrawalLimit;\\n\\n /// @notice Returns if the withdrawal with the hash is executed\\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\\n\\n /// @param user User address\\n /// @param amount Amount\\n /// @dev Reverts if user address or amount is zero\\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\\n require(user != address(0), \\\"User address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n _;\\n }\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n /// @param _token Contract address of the ERC20 token that prepayments are\\n /// made in\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager,\\n address _token\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n require(_token != address(0), \\\"Token address zero\\\");\\n token = _token;\\n withdrawalSignerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitIncreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitDecreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\\n );\\n claimerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n CLAIMER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Called by the user that has not set a withdrawal destination to\\n /// set a withdrawal destination, or called by the withdrawal destination\\n /// of a user to set a new withdrawal destination\\n /// @param user User address\\n /// @param withdrawalDestination Withdrawal destination\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external override {\\n require(user != withdrawalDestination, \\\"Same user and destination\\\");\\n require(\\n (msg.sender == user &&\\n userToWithdrawalDestination[user] == address(0)) ||\\n (msg.sender == userToWithdrawalDestination[user]),\\n \\\"Sender not destination\\\"\\n );\\n userToWithdrawalDestination[user] = withdrawalDestination;\\n emit SetWithdrawalDestination(user, withdrawalDestination);\\n }\\n\\n /// @notice Called to increase the withdrawal limit of the user\\n /// @dev This function is intended to be used to revert faulty\\n /// `decreaseUserWithdrawalLimit()` calls\\n /// @param user User address\\n /// @param amount Amount to increase the withdrawal limit by\\n /// @return withdrawalLimit Increased withdrawal limit\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitIncreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot increase withdrawal limit\\\"\\n );\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit IncreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to decrease the withdrawal limit of the user\\n /// @param user User address\\n /// @param amount Amount to decrease the withdrawal limit by\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitDecreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot decrease withdrawal limit\\\"\\n );\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit DecreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to claim tokens\\n /// @param recipient Recipient address\\n /// @param amount Amount of tokens to claim\\n function claim(address recipient, uint256 amount) external override {\\n require(recipient != address(0), \\\"Recipient address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n claimerRole,\\n msg.sender\\n ),\\n \\\"Cannot claim\\\"\\n );\\n emit Claimed(recipient, amount, msg.sender);\\n require(\\n IERC20(token).transfer(recipient, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to deposit tokens on behalf of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @return withdrawalLimit Increased withdrawal limit\\n function deposit(\\n address user,\\n uint256 amount\\n )\\n public\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\\n require(\\n IERC20(token).transferFrom(msg.sender, address(this), amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\\n /// of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @param deadline Deadline of the permit\\n /// @param v v component of the signature\\n /// @param r r component of the signature\\n /// @param s s component of the signature\\n /// @return withdrawalLimit Increased withdrawal limit\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external override returns (uint256 withdrawalLimit) {\\n IERC20Permit(token).permit(\\n msg.sender,\\n address(this),\\n amount,\\n deadline,\\n v,\\n r,\\n s\\n );\\n withdrawalLimit = deposit(user, amount);\\n }\\n\\n /// @notice Called by a user to withdraw tokens\\n /// @param amount Amount of tokens to withdraw\\n /// @param expirationTimestamp Expiration timestamp of the signature\\n /// @param withdrawalSigner Address of the account that signed the\\n /// withdrawal\\n /// @param signature Withdrawal signature\\n /// @return withdrawalDestination Withdrawal destination\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n )\\n external\\n override\\n returns (address withdrawalDestination, uint256 withdrawalLimit)\\n {\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(block.timestamp < expirationTimestamp, \\\"Signature expired\\\");\\n bytes32 withdrawalHash = keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n msg.sender,\\n amount,\\n expirationTimestamp\\n )\\n );\\n require(\\n !withdrawalWithHashIsExecuted[withdrawalHash],\\n \\\"Withdrawal already executed\\\"\\n );\\n require(\\n withdrawalSigner == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n withdrawalSignerRole,\\n withdrawalSigner\\n ),\\n \\\"Cannot sign withdrawal\\\"\\n );\\n require(\\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\\n withdrawalSigner,\\n \\\"Signature mismatch\\\"\\n );\\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\\n withdrawalDestination = msg.sender;\\n } else {\\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\\n }\\n emit Withdrew(\\n msg.sender,\\n withdrawalHash,\\n amount,\\n expirationTimestamp,\\n withdrawalSigner,\\n withdrawalDestination,\\n withdrawalLimit\\n );\\n require(\\n IERC20(token).transfer(withdrawalDestination, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n}\\n\",\"keccak256\":\"0x74314a7fbed41c4bb318a24b7c2cb104f2fea2211f43d03f76aead2ad3858052\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IPrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\\n event SetWithdrawalDestination(\\n address indexed user,\\n address withdrawalDestination\\n );\\n\\n event IncreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event DecreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Claimed(address recipient, uint256 amount, address sender);\\n\\n event Deposited(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Withdrew(\\n address indexed user,\\n bytes32 indexed withdrawalHash,\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n address withdrawalDestination,\\n uint256 withdrawalLimit\\n );\\n\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external;\\n\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function claim(address recipient, uint256 amount) external;\\n\\n function deposit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external returns (uint256 withdrawalLimit);\\n\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\\n\\n function withdrawalSignerRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\\n\\n function claimerRole() external view returns (bytes32);\\n\\n function token() external view returns (address);\\n}\\n\",\"keccak256\":\"0x15ec7b40b9be1ea7ca88b39d6a8a5a94f213977565c6b754ad4b2f5ffb7b9710\",\"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": "0x6101a06040523480156200001257600080fd5b50604051620029e2380380620029e2833981016040819052620000359162000468565b83838382826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620005ea565b50806040516020016200010b9190620006b6565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000326565b60e0525050506001600160a01b038116620001eb5760405162461bcd60e51b8152602060048201526012602482015271546f6b656e2061646472657373207a65726f60701b604482015260640162000080565b6001600160a01b0381166101805260c0516200023a906200020c9062000326565b6040805180820190915260118152702bb4ba34323930bbb0b61039b4b3b732b960791b6020820152620003a0565b6101005260c0516200028b90620002519062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420696e63726561736572006020820152620003a0565b6101205260c051620002dc90620002a29062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420646563726561736572006020820152620003a0565b6101405260c0516200031790620002f39062000326565b60408051808201909152600781526621b630b4b6b2b960c91b6020820152620003a0565b6101605250620006d492505050565b60006200039a6200036b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620003dc8383604051602001620003ba9190620006b6565b60405160208183030381529060405280519060200120620003e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200042757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200045f57818101518382015260200162000445565b50506000910152565b600080600080608085870312156200047f57600080fd5b6200048a856200040f565b60208601519094506001600160401b0380821115620004a857600080fd5b818701915087601f830112620004bd57600080fd5b815181811115620004d257620004d26200042c565b604051601f8201601f19908116603f01168101908382118183101715620004fd57620004fd6200042c565b816040528281528a60208487010111156200051757600080fd5b6200052a83602083016020880162000442565b809750505050505062000540604086016200040f565b915062000550606086016200040f565b905092959194509250565b600181811c908216806200057057607f821691505b6020821081036200059157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005e557600081815260208120601f850160051c81016020861015620005c05750805b601f850160051c820191505b81811015620005e157828155600101620005cc565b5050505b505050565b81516001600160401b038111156200060657620006066200042c565b6200061e816200061784546200055b565b8462000597565b602080601f8311600181146200065657600084156200063d5750858301515b600019600386901b1c1916600185901b178555620005e1565b600085815260208120601f198616915b82811015620006875788860151825594840194600190910190840162000666565b5085821015620006a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620006ca81846020870162000442565b9190910192915050565b60805160a05160c05160e0516101005161012051610140516101605161018051612230620007b2600039600081816105500152818161082b01528181610c8901528181610f3301526119d70152600081816103fd0152610dda0152600081816101e60152610a5b015260008181610367015261124a0152600081816103a101526116e4015260006101ac0152600081816102fc01528181610a2501528181610da401528181611214015261169c0152600050506000818161024001528181610a8701528181610e0601528181611276015261171a01526122306000f3fe608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "params": { - "amount": "Amount of tokens to deposit", - "deadline": "Deadline of the permit", - "r": "r component of the signature", - "s": "s component of the signature", - "user": "User address", - "v": "v component of the signature" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "claim(address,uint256)": { - "params": { - "amount": "Amount of tokens to claim", - "recipient": "Recipient address" - } - }, - "constructor": { - "params": { - "_accessControlRegistry": "AccessControlRegistry contract address", - "_adminRoleDescription": "Admin role description", - "_manager": "Manager address", - "_token": "Contract address of the ERC20 token that prepayments are made in" - } - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "params": { - "amount": "Amount to decrease the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Decreased withdrawal limit" - } - }, - "deposit(address,uint256)": { - "params": { - "amount": "Amount of tokens to deposit", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "details": "This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls", - "params": { - "amount": "Amount to increase the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "multicall(bytes[])": { - "params": { - "data": "Array of calldata of batched calls" - }, - "returns": { - "returndata": "Array of returndata of batched calls" - } - }, - "setWithdrawalDestination(address,address)": { - "params": { - "user": "User address", - "withdrawalDestination": "Withdrawal destination" - } - }, - "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(uint256,uint256,address,bytes)": { - "params": { - "amount": "Amount of tokens to withdraw", - "expirationTimestamp": "Expiration timestamp of the signature", - "signature": "Withdrawal signature", - "withdrawalSigner": "Address of the account that signed the withdrawal" - }, - "returns": { - "withdrawalDestination": "Withdrawal destination", - "withdrawalLimit": "Decreased withdrawal limit" - } - } - }, - "title": "Contract that enables micropayments to be prepaid in batch", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "CLAIMER_ROLE_DESCRIPTION()": { - "notice": "Claimer role description" - }, - "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit decreaser role description" - }, - "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit increaser role description" - }, - "WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()": { - "notice": "Withdrawal signer role description" - }, - "accessControlRegistry()": { - "notice": "AccessControlRegistry contract address" - }, - "adminRole()": { - "notice": "Admin role" - }, - "adminRoleDescription()": { - "notice": "Admin role description" - }, - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "notice": "Called to apply a ERC2612 permit and deposit tokens on behalf of a user" - }, - "claim(address,uint256)": { - "notice": "Called to claim tokens" - }, - "claimerRole()": { - "notice": "Claimer role" - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to decrease the withdrawal limit of the user" - }, - "deposit(address,uint256)": { - "notice": "Called to deposit tokens on behalf of a user" - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to increase the withdrawal limit of the user" - }, - "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" - }, - "setWithdrawalDestination(address,address)": { - "notice": "Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination" - }, - "token()": { - "notice": "Contract address of the ERC20 token that prepayments can be made in" - }, - "tryMulticall(bytes[])": { - "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" - }, - "userToWithdrawalDestination(address)": { - "notice": "Returns the withdrawal destination of the user" - }, - "userToWithdrawalLimit(address)": { - "notice": "Returns the withdrawal limit of the user" - }, - "userWithdrawalLimitDecreaserRole()": { - "notice": "User withdrawal limit decreaser role" - }, - "userWithdrawalLimitIncreaserRole()": { - "notice": "User withdrawal limit increaser role" - }, - "withdraw(uint256,uint256,address,bytes)": { - "notice": "Called by a user to withdraw tokens" - }, - "withdrawalSignerRole()": { - "notice": "Withdrawal signer role" - }, - "withdrawalWithHashIsExecuted(bytes32)": { - "notice": "Returns if the withdrawal with the hash is executed" - } - }, - "notice": "`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6929, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 18952, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalDestination", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_address)" - }, - { - "astId": 18957, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalLimit", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 18962, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "withdrawalWithHashIsExecuted", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_address)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/deployments/ethereum-goerli-testnet/ProxyFactory.json b/deployments/ethereum-goerli-testnet/ProxyFactory.json index dc26bc6b..71ff98b6 100644 --- a/deployments/ethereum-goerli-testnet/ProxyFactory.json +++ b/deployments/ethereum-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x7b7b427f4e72bec71051a99060d75b44047ce2466515b9c4b5efdca5c20efec4", + "transactionHash": "0xbe005d82894c1fc2367eb992bcd436bff589684106f9568b8c2e927557f8f920", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 84, + "transactionIndex": 33, "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf5dba6d74be7f156b75a8a8bdf0f5101c4d5aef3b63e8d5f13139d45e0f2db27", - "transactionHash": "0x7b7b427f4e72bec71051a99060d75b44047ce2466515b9c4b5efdca5c20efec4", + "blockHash": "0xe0e155616d0affad96e17aa65119aae65db70e63154757ec648307a38c86cdea", + "transactionHash": "0xbe005d82894c1fc2367eb992bcd436bff589684106f9568b8c2e927557f8f920", "logs": [], - "blockNumber": 8665875, - "cumulativeGasUsed": "16160344", + "blockNumber": 10173008, + "cumulativeGasUsed": "3033297", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/ethereum-goerli-testnet/RequesterAuthorizerWithErc721.json b/deployments/ethereum-goerli-testnet/RequesterAuthorizerWithErc721.json index 009e61a6..0f31e6fc 100644 --- a/deployments/ethereum-goerli-testnet/RequesterAuthorizerWithErc721.json +++ b/deployments/ethereum-goerli-testnet/RequesterAuthorizerWithErc721.json @@ -1,5 +1,5 @@ { - "address": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2", + "address": "0xD4a3e7cd4699f1D38901000C8AE7f2E1EF40723e", "abi": [ { "inputs": [ @@ -1025,28 +1025,28 @@ "type": "function" } ], - "transactionHash": "0x1eb534dd882a08a69fdd7ba260b07689080a525eff82c951a99c1da18ef04c03", + "transactionHash": "0x44577fcf743fe42bf5a9c8fe7fd449ec737144ebe6a5353f5ec0b40018865cfa", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 16, + "transactionIndex": 40, "gasUsed": "2698635", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x808908bfcd6d6ff28b61818a667d46f691c8a5abdd15b8042b914643c42deb8f", - "transactionHash": "0x1eb534dd882a08a69fdd7ba260b07689080a525eff82c951a99c1da18ef04c03", + "blockHash": "0xf136c4b0504cbad066c7a92d36040a835138d73ad0a41f2262ba358330cbf3a2", + "transactionHash": "0x44577fcf743fe42bf5a9c8fe7fd449ec737144ebe6a5353f5ec0b40018865cfa", "logs": [], - "blockNumber": 9010094, - "cumulativeGasUsed": "4171033", + "blockNumber": 10173019, + "cumulativeGasUsed": "18928265", "status": 1, "byzantium": true }, - "args": ["0x12D82f38a038A71b0843BD3256CD1E0A1De74834", "RequesterAuthorizerWithErc721 admin"], + "args": ["0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "RequesterAuthorizerWithErc721 admin"], "numDeployments": 1, - "solcInputHash": "f2801ef4a5bbfe0372728f499155ff5d", - "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\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"DepositedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"InitiatedTokenWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"RevokedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDepositorFreezeStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetRequesterBlockStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetWithdrawalLeadTime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterFrom\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterTo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"WithdrewToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REQUESTER_BLOCKER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_LEAD_TIME_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\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToBlockStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"internalType\":\"enum IRequesterAuthorizerWithErc721.DepositState\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToDepositorToFreezeStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToWithdrawalLeadTime\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveDepositorFreezerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"depositorFreezerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveRequesterBlockerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requesterBlockerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveWithdrawalLeadTimeSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"withdrawalLeadTimeSetterRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"initiateTokenWithdrawal\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"revokeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setDepositorFreezeStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setRequesterBlockStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalLeadTime\",\"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\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdPrevious\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterPrevious\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdNext\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterNext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"updateDepositRequester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"withdrawToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.\",\"kind\":\"dev\",\"methods\":{\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\",\"tokenId\":\"Token ID\",\"withdrawalLeadTime\":\"Withdrawal lead time captured at deposit-time\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\"}},\"deriveDepositorFreezerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"depositorFreezerRole\":\"Depositor freezer role\"}},\"deriveRequesterBlockerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"requesterBlockerRole\":\"Requester blocker role\"}},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"withdrawalLeadTimeSetterRole\":\"Withdrawal lead time setter role\"}},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"details\":\"The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.\",\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\"}},\"isAuthorized(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"_0\":\"Authorization status\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"The first argument is the operator, which we do not need\",\"params\":{\"_data\":\"Airnode address, chain ID and requester address in ABI-encoded form\",\"_from\":\"Account from which the token is transferred\",\"_tokenId\":\"Token ID\"},\"returns\":{\"_0\":\"`onERC721Received()` function selector\"}},\"revokeToken(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"}},\"setDepositorFreezeStatus(address,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"depositor\":\"Depositor address\",\"status\":\"Freeze status\"}},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"status\":\"Block status\"}},\"setWithdrawalLeadTime(address,uint32)\":{\"params\":{\"airnode\":\"Airnode address\",\"withdrawalLeadTime\":\"Withdrawal lead time\"}},\"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\"}},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"details\":\"This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time\",\"params\":{\"airnode\":\"Airnode address\",\"chainIdNext\":\"Next chain ID\",\"chainIdPrevious\":\"Previous chain ID\",\"requesterNext\":\"Next requester address\",\"requesterPrevious\":\"Previous requester address\",\"token\":\"Token address\"}},\"withdrawToken(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"}}},\"title\":\"Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION()\":{\"notice\":\"Depositor freezer role description\"},\"REQUESTER_BLOCKER_ROLE_DESCRIPTION()\":{\"notice\":\"Requester blocker role description\"},\"WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal lead time setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)\":{\"notice\":\"If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization.\"},\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)\":{\"notice\":\"Deposits of the token with the address made for the Airnode to authorize the requester address on the chain\"},\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"notice\":\"Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain\"},\"airnodeToDepositorToFreezeStatus(address,address)\":{\"notice\":\"If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw.\"},\"airnodeToWithdrawalLeadTime(address)\":{\"notice\":\"Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit.\"},\"deriveDepositorFreezerRole(address)\":{\"notice\":\"Derives the depositor freezer role for the Airnode\"},\"deriveRequesterBlockerRole(address)\":{\"notice\":\"Derives the requester blocker role for the Airnode\"},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"notice\":\"Derives the withdrawal lead time setter role for the Airnode\"},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to initiate withdrawal\"},\"isAuthorized(address,uint256,address,address)\":{\"notice\":\"Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"onERC721Received(address,address,uint256,bytes)\":{\"notice\":\"Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester\"},\"revokeToken(address,uint256,address,address,address)\":{\"notice\":\"Called to revoke the token deposited to authorize a requester that is blocked now\"},\"setDepositorFreezeStatus(address,address,bool)\":{\"notice\":\"Called by the Airnode or its depositor freezers to set the freeze status of the depositor\"},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"notice\":\"Called by the Airnode or its requester blockers to set the block status of the requester\"},\"setWithdrawalLeadTime(address,uint32)\":{\"notice\":\"Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to update the requester for which they have deposited the token for\"},\"withdrawToken(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to withdraw\"}},\"notice\":\"For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/authorizers/RequesterAuthorizerWithErc721.sol\":\"RequesterAuthorizerWithErc721\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"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/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/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/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/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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/authorizers/RequesterAuthorizerWithErc721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/metatx/ERC2771Context.sol\\\";\\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 ERC2771Context,\\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 ERC2771Context(_accessControlRegistry)\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveWithdrawalLeadTimeSetterRole(airnode),\\n _msgSender()\\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, _msgSender());\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveRequesterBlockerRole(airnode),\\n _msgSender()\\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 _msgSender()\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveDepositorFreezerRole(airnode),\\n _msgSender()\\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, _msgSender());\\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][_msgSender()];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainIdPrevious][requesterPrevious][token];\\n Deposit\\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\\n .depositorToDeposit[_msgSender()];\\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[_msgSender()].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[_msgSender()] = Deposit({\\n tokenId: tokenId,\\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Active\\n });\\n requesterPreviousTokenDeposits.depositorToDeposit[\\n _msgSender()\\n ] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit UpdatedDepositRequesterTo(\\n airnode,\\n requesterNext,\\n _msgSender(),\\n chainIdNext,\\n token,\\n tokenId,\\n requesterNextTokenDepositCount\\n );\\n emit UpdatedDepositRequesterFrom(\\n airnode,\\n requesterPrevious,\\n _msgSender(),\\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[\\n _msgSender()\\n ];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainId][requester][token];\\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\\n _msgSender()\\n ];\\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[_msgSender()] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit WithdrewToken(\\n airnode,\\n requester,\\n _msgSender(),\\n chainId,\\n token,\\n tokenId,\\n tokenDepositCount\\n );\\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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\",\"keccak256\":\"0xbcc385f2ec8c01559b2b00c6b21184a152a024b5c66d321b33d13a48d656f385\",\"license\":\"MIT\"},\"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\",\"keccak256\":\"0xb7ef76aef8e6246717d9447c9b12030c59ee58cf77126f711b62c8cd935efc6f\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x60e06040523480156200001157600080fd5b506040516200326538038062003265833981016040819052620000349162000170565b6001600160a01b0382166080819052829082906200008c5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000df5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000083565b6001600160a01b03821660a0526000620000fa8282620002da565b50806040516020016200010e9190620003a6565b60408051601f19818403018152919052805160209091012060c05250620003c492505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001675781810151838201526020016200014d565b50506000910152565b600080604083850312156200018457600080fd5b82516001600160a01b03811681146200019c57600080fd5b60208401519092506001600160401b0380821115620001ba57600080fd5b818501915085601f830112620001cf57600080fd5b815181811115620001e457620001e462000134565b604051601f8201601f19908116603f011681019083821181831017156200020f576200020f62000134565b816040528281528860208487010111156200022957600080fd5b6200023c8360208301602088016200014a565b80955050505050509250929050565b600181811c908216806200026057607f821691505b6020821081036200028157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d557600081815260208120601f850160051c81016020861015620002b05750805b601f850160051c820191505b81811015620002d157828155600101620002bc565b5050505b505050565b81516001600160401b03811115620002f657620002f662000134565b6200030e816200030784546200024b565b8462000287565b602080601f8311600181146200034657600084156200032d5750858301515b600019600386901b1c1916600185901b178555620002d1565b600085815260208120601f198616915b82811015620003775788860151825594840194600190910190840162000356565b5085821015620003965787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620003ba8184602087016200014a565b9190910192915050565b60805160a05160c051612e556200041060003960006126c801526000818161022e01528181610a7501528181610edd0152611ffc01526000818161030d01526126310152612e556000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"DepositedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"InitiatedTokenWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"RevokedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDepositorFreezeStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetRequesterBlockStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetWithdrawalLeadTime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterFrom\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterTo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"WithdrewToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REQUESTER_BLOCKER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_LEAD_TIME_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\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToBlockStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"internalType\":\"enum IRequesterAuthorizerWithErc721.DepositState\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToDepositorToFreezeStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToWithdrawalLeadTime\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveDepositorFreezerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"depositorFreezerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveRequesterBlockerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requesterBlockerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveWithdrawalLeadTimeSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"withdrawalLeadTimeSetterRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"initiateTokenWithdrawal\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"revokeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setDepositorFreezeStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setRequesterBlockStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalLeadTime\",\"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\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdPrevious\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterPrevious\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdNext\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterNext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"updateDepositRequester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"withdrawToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.\",\"kind\":\"dev\",\"methods\":{\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\",\"tokenId\":\"Token ID\",\"withdrawalLeadTime\":\"Withdrawal lead time captured at deposit-time\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\"}},\"deriveDepositorFreezerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"depositorFreezerRole\":\"Depositor freezer role\"}},\"deriveRequesterBlockerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"requesterBlockerRole\":\"Requester blocker role\"}},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"withdrawalLeadTimeSetterRole\":\"Withdrawal lead time setter role\"}},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"details\":\"The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.\",\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\"}},\"isAuthorized(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"_0\":\"Authorization status\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"The first argument is the operator, which we do not need\",\"params\":{\"_data\":\"Airnode address, chain ID and requester address in ABI-encoded form\",\"_from\":\"Account from which the token is transferred\",\"_tokenId\":\"Token ID\"},\"returns\":{\"_0\":\"`onERC721Received()` function selector\"}},\"revokeToken(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"}},\"setDepositorFreezeStatus(address,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"depositor\":\"Depositor address\",\"status\":\"Freeze status\"}},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"status\":\"Block status\"}},\"setWithdrawalLeadTime(address,uint32)\":{\"params\":{\"airnode\":\"Airnode address\",\"withdrawalLeadTime\":\"Withdrawal lead time\"}},\"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\"}},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"details\":\"This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time\",\"params\":{\"airnode\":\"Airnode address\",\"chainIdNext\":\"Next chain ID\",\"chainIdPrevious\":\"Previous chain ID\",\"requesterNext\":\"Next requester address\",\"requesterPrevious\":\"Previous requester address\",\"token\":\"Token address\"}},\"withdrawToken(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"}}},\"title\":\"Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION()\":{\"notice\":\"Depositor freezer role description\"},\"REQUESTER_BLOCKER_ROLE_DESCRIPTION()\":{\"notice\":\"Requester blocker role description\"},\"WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal lead time setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)\":{\"notice\":\"If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization.\"},\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)\":{\"notice\":\"Deposits of the token with the address made for the Airnode to authorize the requester address on the chain\"},\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"notice\":\"Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain\"},\"airnodeToDepositorToFreezeStatus(address,address)\":{\"notice\":\"If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw.\"},\"airnodeToWithdrawalLeadTime(address)\":{\"notice\":\"Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit.\"},\"deriveDepositorFreezerRole(address)\":{\"notice\":\"Derives the depositor freezer role for the Airnode\"},\"deriveRequesterBlockerRole(address)\":{\"notice\":\"Derives the requester blocker role for the Airnode\"},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"notice\":\"Derives the withdrawal lead time setter role for the Airnode\"},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to initiate withdrawal\"},\"isAuthorized(address,uint256,address,address)\":{\"notice\":\"Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"onERC721Received(address,address,uint256,bytes)\":{\"notice\":\"Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester\"},\"revokeToken(address,uint256,address,address,address)\":{\"notice\":\"Called to revoke the token deposited to authorize a requester that is blocked now\"},\"setDepositorFreezeStatus(address,address,bool)\":{\"notice\":\"Called by the Airnode or its depositor freezers to set the freeze status of the depositor\"},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"notice\":\"Called by the Airnode or its requester blockers to set the block status of the requester\"},\"setWithdrawalLeadTime(address,uint32)\":{\"notice\":\"Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to update the requester for which they have deposited the token for\"},\"withdrawToken(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to withdraw\"}},\"notice\":\"For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/authorizers/RequesterAuthorizerWithErc721.sol\":\"RequesterAuthorizerWithErc721\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"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/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/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/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/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/authorizers/RequesterAuthorizerWithErc721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/metatx/ERC2771Context.sol\\\";\\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 ERC2771Context,\\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 ERC2771Context(_accessControlRegistry)\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveWithdrawalLeadTimeSetterRole(airnode),\\n _msgSender()\\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, _msgSender());\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveRequesterBlockerRole(airnode),\\n _msgSender()\\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 _msgSender()\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveDepositorFreezerRole(airnode),\\n _msgSender()\\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, _msgSender());\\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][_msgSender()];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainIdPrevious][requesterPrevious][token];\\n Deposit\\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\\n .depositorToDeposit[_msgSender()];\\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[_msgSender()].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[_msgSender()] = Deposit({\\n tokenId: tokenId,\\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Active\\n });\\n requesterPreviousTokenDeposits.depositorToDeposit[\\n _msgSender()\\n ] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit UpdatedDepositRequesterTo(\\n airnode,\\n requesterNext,\\n _msgSender(),\\n chainIdNext,\\n token,\\n tokenId,\\n requesterNextTokenDepositCount\\n );\\n emit UpdatedDepositRequesterFrom(\\n airnode,\\n requesterPrevious,\\n _msgSender(),\\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[\\n _msgSender()\\n ];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainId][requester][token];\\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\\n _msgSender()\\n ];\\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[_msgSender()] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit WithdrewToken(\\n airnode,\\n requester,\\n _msgSender(),\\n chainId,\\n token,\\n tokenId,\\n tokenDepositCount\\n );\\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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\",\"keccak256\":\"0xbcc385f2ec8c01559b2b00c6b21184a152a024b5c66d321b33d13a48d656f385\",\"license\":\"MIT\"},\"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\",\"keccak256\":\"0xb7ef76aef8e6246717d9447c9b12030c59ee58cf77126f711b62c8cd935efc6f\",\"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": "0x60e06040523480156200001157600080fd5b506040516200326538038062003265833981016040819052620000349162000170565b6001600160a01b0382166080819052829082906200008c5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000df5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000083565b6001600160a01b03821660a0526000620000fa8282620002da565b50806040516020016200010e9190620003a6565b60408051601f19818403018152919052805160209091012060c05250620003c492505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001675781810151838201526020016200014d565b50506000910152565b600080604083850312156200018457600080fd5b82516001600160a01b03811681146200019c57600080fd5b60208401519092506001600160401b0380821115620001ba57600080fd5b818501915085601f830112620001cf57600080fd5b815181811115620001e457620001e462000134565b604051601f8201601f19908116603f011681019083821181831017156200020f576200020f62000134565b816040528281528860208487010111156200022957600080fd5b6200023c8360208301602088016200014a565b80955050505050509250929050565b600181811c908216806200026057607f821691505b6020821081036200028157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d557600081815260208120601f850160051c81016020861015620002b05750805b601f850160051c820191505b81811015620002d157828155600101620002bc565b5050505b505050565b81516001600160401b03811115620002f657620002f662000134565b6200030e816200030784546200024b565b8462000287565b602080601f8311600181146200034657600084156200032d5750858301515b600019600386901b1c1916600185901b178555620002d1565b600085815260208120601f198616915b82811015620003775788860151825594840194600190910190840162000356565b5085821015620003965787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620003ba8184602087016200014a565b9190910192915050565b60805160a05160c051612e556200041060003960006126c801526000818161022e01528181610a7501528181610edd0152611ffc01526000818161030d01526126310152612e556000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220d75218330680091db034d77f35ef1ddd6fa3b163cf24642dadca8c4a2216966c64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220d75218330680091db034d77f35ef1ddd6fa3b163cf24642dadca8c4a2216966c64736f6c63430008110033", "devdoc": { "details": "Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.", "kind": "dev", @@ -1281,7 +1281,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "adminRoleDescription", "offset": 0, @@ -1289,15 +1289,15 @@ "type": "t_string_storage" }, { - "astId": 13104, + "astId": 12884, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits", "offset": 0, "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))" + "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage))))" }, { - "astId": 13110, + "astId": 12890, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "airnodeToWithdrawalLeadTime", "offset": 0, @@ -1305,7 +1305,7 @@ "type": "t_mapping(t_address,t_uint32)" }, { - "astId": 13120, + "astId": 12900, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "airnodeToChainIdToRequesterToBlockStatus", "offset": 0, @@ -1313,7 +1313,7 @@ "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))" }, { - "astId": 13128, + "astId": 12908, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "airnodeToDepositorToFreezeStatus", "offset": 0, @@ -1332,7 +1332,7 @@ "label": "bool", "numberOfBytes": "1" }, - "t_enum(DepositState)14691": { + "t_enum(DepositState)14471": { "encoding": "inplace", "label": "enum IRequesterAuthorizerWithErc721.DepositState", "numberOfBytes": "1" @@ -1351,12 +1351,12 @@ "numberOfBytes": "32", "value": "t_mapping(t_address,t_bool)" }, - "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))": { + "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))", "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)" + "value": "t_mapping(t_address,t_struct(TokenDeposits)12822_storage)" }, "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))": { "encoding": "mapping", @@ -1365,26 +1365,26 @@ "numberOfBytes": "32", "value": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" }, - "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))": { + "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage))))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))))", "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))" + "value": "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage)))" }, - "t_mapping(t_address,t_struct(Deposit)13052_storage)": { + "t_mapping(t_address,t_struct(Deposit)12832_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct RequesterAuthorizerWithErc721.Deposit)", "numberOfBytes": "32", - "value": "t_struct(Deposit)13052_storage" + "value": "t_struct(Deposit)12832_storage" }, - "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)": { + "t_mapping(t_address,t_struct(TokenDeposits)12822_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)", "numberOfBytes": "32", - "value": "t_struct(TokenDeposits)13042_storage" + "value": "t_struct(TokenDeposits)12822_storage" }, "t_mapping(t_address,t_uint32)": { "encoding": "mapping", @@ -1400,24 +1400,24 @@ "numberOfBytes": "32", "value": "t_mapping(t_address,t_bool)" }, - "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))": { + "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage)))": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)))", "numberOfBytes": "32", - "value": "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))" + "value": "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)12822_storage))" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(Deposit)13052_storage": { + "t_struct(Deposit)12832_storage": { "encoding": "inplace", "label": "struct RequesterAuthorizerWithErc721.Deposit", "members": [ { - "astId": 13044, + "astId": 12824, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "tokenId", "offset": 0, @@ -1425,7 +1425,7 @@ "type": "t_uint256" }, { - "astId": 13046, + "astId": 12826, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "withdrawalLeadTime", "offset": 0, @@ -1433,7 +1433,7 @@ "type": "t_uint32" }, { - "astId": 13048, + "astId": 12828, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "earliestWithdrawalTime", "offset": 4, @@ -1441,22 +1441,22 @@ "type": "t_uint32" }, { - "astId": 13051, + "astId": 12831, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "state", "offset": 8, "slot": "1", - "type": "t_enum(DepositState)14691" + "type": "t_enum(DepositState)14471" } ], "numberOfBytes": "64" }, - "t_struct(TokenDeposits)13042_storage": { + "t_struct(TokenDeposits)12822_storage": { "encoding": "inplace", "label": "struct RequesterAuthorizerWithErc721.TokenDeposits", "members": [ { - "astId": 13036, + "astId": 12816, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "count", "offset": 0, @@ -1464,12 +1464,12 @@ "type": "t_uint256" }, { - "astId": 13041, + "astId": 12821, "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", "label": "depositorToDeposit", "offset": 0, "slot": "1", - "type": "t_mapping(t_address,t_struct(Deposit)13052_storage)" + "type": "t_mapping(t_address,t_struct(Deposit)12832_storage)" } ], "numberOfBytes": "64" diff --git a/deployments/ethereum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/ethereum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/ethereum-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/ethereum-sepolia-testnet/AccessControlRegistry.json b/deployments/ethereum-sepolia-testnet/AccessControlRegistry.json index 8f47ec58..f93ce915 100644 --- a/deployments/ethereum-sepolia-testnet/AccessControlRegistry.json +++ b/deployments/ethereum-sepolia-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0xd1f1cbcd9f315973e53632ebf41c81ee59c48974987807d927ddd501ddc22c49", + "transactionHash": "0xbeb4ca296281b7c14c4d4b85583ab384b80384ebe5e7e9ee4c9c579b0226efb9", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 4, - "gasUsed": { "type": "BigNumber", "hex": "0x1a43f6" }, + "transactionIndex": 58, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0ec4baa5854a4794cae9cd57d87315da9d2ece3c47441db2f65b0763f762bb1a", - "transactionHash": "0xd1f1cbcd9f315973e53632ebf41c81ee59c48974987807d927ddd501ddc22c49", + "blockHash": "0x8256b1f97b93fea1c8b18ebfcfe1804034519a3117ba12ec4a7df7636207dbaa", + "transactionHash": "0xbeb4ca296281b7c14c4d4b85583ab384b80384ebe5e7e9ee4c9c579b0226efb9", "logs": [], - "blockNumber": 3087214, - "confirmations": 86843, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1cc43b" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x07" }, + "blockNumber": 4840249, + "cumulativeGasUsed": "9332929", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/ethereum-sepolia-testnet/Api3ServerV1.json b/deployments/ethereum-sepolia-testnet/Api3ServerV1.json index 43c6352e..153476f3 100644 --- a/deployments/ethereum-sepolia-testnet/Api3ServerV1.json +++ b/deployments/ethereum-sepolia-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xd85e4382b9b59b2196b146315e54666aa967e2207df7e6bbdb5c2316f51dbc1c", + "transactionHash": "0xd528334b70231c02460523bf3cf83b5858fdd257e064498cdfddb87d4a07e89e", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, + "transactionIndex": 89, "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6a62af386a0b1684d2d0d56d729d6f9ad4c8033b22e88fe6384243026bff9cbf", - "transactionHash": "0xd85e4382b9b59b2196b146315e54666aa967e2207df7e6bbdb5c2316f51dbc1c", + "blockHash": "0xce431454b20c4ddcf48b9a58b51085d849a472edf41d312641418c64f4e9d567", + "transactionHash": "0xd528334b70231c02460523bf3cf83b5858fdd257e064498cdfddb87d4a07e89e", "logs": [], - "blockNumber": 3103453, - "cumulativeGasUsed": "3083047", + "blockNumber": 4840540, + "cumulativeGasUsed": "13506653", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/ethereum-sepolia-testnet/OrderPayable.json b/deployments/ethereum-sepolia-testnet/OrderPayable.json deleted file mode 100644 index dfaa933e..00000000 --- a/deployments/ethereum-sepolia-testnet/OrderPayable.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", - "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": "0x678994fb5914b67eaf6ea8b944a1d5804446cf41435ae36dffbb7a34d9a9365b", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 56, - "gasUsed": "1235415", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xda4e5e0bef83527ad6c523b853ec66b57590e5166920d8c97530a01421169275", - "transactionHash": "0x678994fb5914b67eaf6ea8b944a1d5804446cf41435ae36dffbb7a34d9a9365b", - "logs": [], - "blockNumber": 3642159, - "cumulativeGasUsed": "8671168", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "OrderPayable admin (API3 Market)", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6" - ], - "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "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": 6427, - "contract": "contracts/utils/OrderPayable.sol:OrderPayable", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 17707, - "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/ethereum-sepolia-testnet/ProxyFactory.json b/deployments/ethereum-sepolia-testnet/ProxyFactory.json index 4cb8db2f..91719783 100644 --- a/deployments/ethereum-sepolia-testnet/ProxyFactory.json +++ b/deployments/ethereum-sepolia-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x780e6c2b0ff970e9fbd65a8f737eef49b4ee01cf93f2fc784624e286fddab28f", + "transactionHash": "0x20a176fa9e52d945dfb3df92411e4f0ad7c105897cd6864f2f232e786f5a626a", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 6, + "transactionIndex": 51, "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x060b383b0fd10b52e3c62af7731c2441c0c48eb708b981086bb259994e15d082", - "transactionHash": "0x780e6c2b0ff970e9fbd65a8f737eef49b4ee01cf93f2fc784624e286fddab28f", + "blockHash": "0x993a6eb44aaace21930e90e7c28d47742a92743e579d95b441c7e62327792343", + "transactionHash": "0x20a176fa9e52d945dfb3df92411e4f0ad7c105897cd6864f2f232e786f5a626a", "logs": [], - "blockNumber": 3103454, - "cumulativeGasUsed": "1997528", + "blockNumber": 4840541, + "cumulativeGasUsed": "12915805", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/ethereum-sepolia-testnet/RequesterAuthorizerWithErc721.json b/deployments/ethereum-sepolia-testnet/RequesterAuthorizerWithErc721.json deleted file mode 100644 index 6e4f0494..00000000 --- a/deployments/ethereum-sepolia-testnet/RequesterAuthorizerWithErc721.json +++ /dev/null @@ -1,1489 +0,0 @@ -{ - "address": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_accessControlRegistry", - "type": "address" - }, - { - "internalType": "string", - "name": "_adminRoleDescription", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "DepositedToken", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "InitiatedTokenWithdrawal", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "RevokedToken", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "status", - "type": "bool" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetDepositorFreezeStatus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "status", - "type": "bool" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetRequesterBlockStatus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetWithdrawalLeadTime", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "UpdatedDepositRequesterFrom", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "UpdatedDepositRequesterTo", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "WithdrewToken", - "type": "event" - }, - { - "inputs": [], - "name": "DEPOSITOR_FREEZER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REQUESTER_BLOCKER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WITHDRAWAL_LEAD_TIME_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": "adminRoleDescription", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToBlockStatus", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits", - "outputs": [ - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToTokenToDepositorToDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - }, - { - "internalType": "enum IRequesterAuthorizerWithErc721.DepositState", - "name": "state", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToDepositorToFreezeStatus", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToWithdrawalLeadTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveDepositorFreezerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "depositorFreezerRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveRequesterBlockerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "requesterBlockerRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveWithdrawalLeadTimeSetterRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "withdrawalLeadTimeSetterRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "initiateTokenWithdrawal", - "outputs": [ - { - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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" - }, - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "revokeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "internalType": "bool", - "name": "status", - "type": "bool" - } - ], - "name": "setDepositorFreezeStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "bool", - "name": "status", - "type": "bool" - } - ], - "name": "setRequesterBlockStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - } - ], - "name": "setWithdrawalLeadTime", - "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": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainIdPrevious", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requesterPrevious", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainIdNext", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requesterNext", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "updateDepositRequester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xbca4ef1a9d98f3ee9c2ebd60aae87fe76f8d1515dcf0eef5a250a43ca7449efc", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 30, - "gasUsed": "2698635", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x72fec91b24c10fb0b34a0f92df60a43c4666565b465534d7e6b821d4ba53a89f", - "transactionHash": "0xbca4ef1a9d98f3ee9c2ebd60aae87fe76f8d1515dcf0eef5a250a43ca7449efc", - "logs": [], - "blockNumber": 3594739, - "cumulativeGasUsed": "4754010", - "status": 1, - "byzantium": true - }, - "args": ["0x12D82f38a038A71b0843BD3256CD1E0A1De74834", "RequesterAuthorizerWithErc721 admin"], - "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"DepositedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"InitiatedTokenWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"RevokedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDepositorFreezeStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetRequesterBlockStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetWithdrawalLeadTime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterFrom\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterTo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"WithdrewToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REQUESTER_BLOCKER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_LEAD_TIME_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\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToBlockStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"internalType\":\"enum IRequesterAuthorizerWithErc721.DepositState\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToDepositorToFreezeStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToWithdrawalLeadTime\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveDepositorFreezerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"depositorFreezerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveRequesterBlockerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requesterBlockerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveWithdrawalLeadTimeSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"withdrawalLeadTimeSetterRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"initiateTokenWithdrawal\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"revokeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setDepositorFreezeStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setRequesterBlockStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalLeadTime\",\"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\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdPrevious\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterPrevious\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdNext\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterNext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"updateDepositRequester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"withdrawToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.\",\"kind\":\"dev\",\"methods\":{\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\",\"tokenId\":\"Token ID\",\"withdrawalLeadTime\":\"Withdrawal lead time captured at deposit-time\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\"}},\"deriveDepositorFreezerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"depositorFreezerRole\":\"Depositor freezer role\"}},\"deriveRequesterBlockerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"requesterBlockerRole\":\"Requester blocker role\"}},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"withdrawalLeadTimeSetterRole\":\"Withdrawal lead time setter role\"}},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"details\":\"The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.\",\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\"}},\"isAuthorized(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"_0\":\"Authorization status\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"The first argument is the operator, which we do not need\",\"params\":{\"_data\":\"Airnode address, chain ID and requester address in ABI-encoded form\",\"_from\":\"Account from which the token is transferred\",\"_tokenId\":\"Token ID\"},\"returns\":{\"_0\":\"`onERC721Received()` function selector\"}},\"revokeToken(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"}},\"setDepositorFreezeStatus(address,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"depositor\":\"Depositor address\",\"status\":\"Freeze status\"}},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"status\":\"Block status\"}},\"setWithdrawalLeadTime(address,uint32)\":{\"params\":{\"airnode\":\"Airnode address\",\"withdrawalLeadTime\":\"Withdrawal lead time\"}},\"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\"}},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"details\":\"This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time\",\"params\":{\"airnode\":\"Airnode address\",\"chainIdNext\":\"Next chain ID\",\"chainIdPrevious\":\"Previous chain ID\",\"requesterNext\":\"Next requester address\",\"requesterPrevious\":\"Previous requester address\",\"token\":\"Token address\"}},\"withdrawToken(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"}}},\"title\":\"Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION()\":{\"notice\":\"Depositor freezer role description\"},\"REQUESTER_BLOCKER_ROLE_DESCRIPTION()\":{\"notice\":\"Requester blocker role description\"},\"WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal lead time setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)\":{\"notice\":\"If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization.\"},\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)\":{\"notice\":\"Deposits of the token with the address made for the Airnode to authorize the requester address on the chain\"},\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"notice\":\"Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain\"},\"airnodeToDepositorToFreezeStatus(address,address)\":{\"notice\":\"If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw.\"},\"airnodeToWithdrawalLeadTime(address)\":{\"notice\":\"Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit.\"},\"deriveDepositorFreezerRole(address)\":{\"notice\":\"Derives the depositor freezer role for the Airnode\"},\"deriveRequesterBlockerRole(address)\":{\"notice\":\"Derives the requester blocker role for the Airnode\"},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"notice\":\"Derives the withdrawal lead time setter role for the Airnode\"},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to initiate withdrawal\"},\"isAuthorized(address,uint256,address,address)\":{\"notice\":\"Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"onERC721Received(address,address,uint256,bytes)\":{\"notice\":\"Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester\"},\"revokeToken(address,uint256,address,address,address)\":{\"notice\":\"Called to revoke the token deposited to authorize a requester that is blocked now\"},\"setDepositorFreezeStatus(address,address,bool)\":{\"notice\":\"Called by the Airnode or its depositor freezers to set the freeze status of the depositor\"},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"notice\":\"Called by the Airnode or its requester blockers to set the block status of the requester\"},\"setWithdrawalLeadTime(address,uint32)\":{\"notice\":\"Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to update the requester for which they have deposited the token for\"},\"withdrawToken(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to withdraw\"}},\"notice\":\"For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/authorizers/RequesterAuthorizerWithErc721.sol\":\"RequesterAuthorizerWithErc721\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"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/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/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/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/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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/authorizers/RequesterAuthorizerWithErc721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/metatx/ERC2771Context.sol\\\";\\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 ERC2771Context,\\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 ERC2771Context(_accessControlRegistry)\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveWithdrawalLeadTimeSetterRole(airnode),\\n _msgSender()\\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, _msgSender());\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveRequesterBlockerRole(airnode),\\n _msgSender()\\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 _msgSender()\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveDepositorFreezerRole(airnode),\\n _msgSender()\\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, _msgSender());\\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][_msgSender()];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainIdPrevious][requesterPrevious][token];\\n Deposit\\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\\n .depositorToDeposit[_msgSender()];\\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[_msgSender()].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[_msgSender()] = Deposit({\\n tokenId: tokenId,\\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Active\\n });\\n requesterPreviousTokenDeposits.depositorToDeposit[\\n _msgSender()\\n ] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit UpdatedDepositRequesterTo(\\n airnode,\\n requesterNext,\\n _msgSender(),\\n chainIdNext,\\n token,\\n tokenId,\\n requesterNextTokenDepositCount\\n );\\n emit UpdatedDepositRequesterFrom(\\n airnode,\\n requesterPrevious,\\n _msgSender(),\\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[\\n _msgSender()\\n ];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainId][requester][token];\\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\\n _msgSender()\\n ];\\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[_msgSender()] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit WithdrewToken(\\n airnode,\\n requester,\\n _msgSender(),\\n chainId,\\n token,\\n tokenId,\\n tokenDepositCount\\n );\\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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\",\"keccak256\":\"0xbcc385f2ec8c01559b2b00c6b21184a152a024b5c66d321b33d13a48d656f385\",\"license\":\"MIT\"},\"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\",\"keccak256\":\"0xb7ef76aef8e6246717d9447c9b12030c59ee58cf77126f711b62c8cd935efc6f\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x60e06040523480156200001157600080fd5b506040516200326538038062003265833981016040819052620000349162000170565b6001600160a01b0382166080819052829082906200008c5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000df5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000083565b6001600160a01b03821660a0526000620000fa8282620002da565b50806040516020016200010e9190620003a6565b60408051601f19818403018152919052805160209091012060c05250620003c492505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001675781810151838201526020016200014d565b50506000910152565b600080604083850312156200018457600080fd5b82516001600160a01b03811681146200019c57600080fd5b60208401519092506001600160401b0380821115620001ba57600080fd5b818501915085601f830112620001cf57600080fd5b815181811115620001e457620001e462000134565b604051601f8201601f19908116603f011681019083821181831017156200020f576200020f62000134565b816040528281528860208487010111156200022957600080fd5b6200023c8360208301602088016200014a565b80955050505050509250929050565b600181811c908216806200026057607f821691505b6020821081036200028157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d557600081815260208120601f850160051c81016020861015620002b05750805b601f850160051c820191505b81811015620002d157828155600101620002bc565b5050505b505050565b81516001600160401b03811115620002f657620002f662000134565b6200030e816200030784546200024b565b8462000287565b602080601f8311600181146200034657600084156200032d5750858301515b600019600386901b1c1916600185901b178555620002d1565b600085815260208120601f198616915b82811015620003775788860151825594840194600190910190840162000356565b5085821015620003965787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620003ba8184602087016200014a565b9190910192915050565b60805160a05160c051612e556200041060003960006126c801526000818161022e01528181610a7501528181610edd0152611ffc01526000818161030d01526126310152612e556000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", - "devdoc": { - "details": "Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.", - "kind": "dev", - "methods": { - "airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "depositor": "Depositor address", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "earliestWithdrawalTime": "Earliest withdrawal time", - "tokenId": "Token ID", - "withdrawalLeadTime": "Withdrawal lead time captured at deposit-time" - } - }, - "constructor": { - "params": { - "_accessControlRegistry": "AccessControlRegistry contract address", - "_adminRoleDescription": "Admin role description" - } - }, - "deriveDepositorFreezerRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "depositorFreezerRole": "Depositor freezer role" - } - }, - "deriveRequesterBlockerRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "requesterBlockerRole": "Requester blocker role" - } - }, - "deriveWithdrawalLeadTimeSetterRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "withdrawalLeadTimeSetterRole": "Withdrawal lead time setter role" - } - }, - "initiateTokenWithdrawal(address,uint256,address,address)": { - "details": "The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.", - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "earliestWithdrawalTime": "Earliest withdrawal time" - } - }, - "isAuthorized(address,uint256,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "_0": "Authorization status" - } - }, - "multicall(bytes[])": { - "params": { - "data": "Array of calldata of batched calls" - }, - "returns": { - "returndata": "Array of returndata of batched calls" - } - }, - "onERC721Received(address,address,uint256,bytes)": { - "details": "The first argument is the operator, which we do not need", - "params": { - "_data": "Airnode address, chain ID and requester address in ABI-encoded form", - "_from": "Account from which the token is transferred", - "_tokenId": "Token ID" - }, - "returns": { - "_0": "`onERC721Received()` function selector" - } - }, - "revokeToken(address,uint256,address,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "depositor": "Depositor address", - "requester": "Requester address", - "token": "Token address" - } - }, - "setDepositorFreezeStatus(address,address,bool)": { - "params": { - "airnode": "Airnode address", - "depositor": "Depositor address", - "status": "Freeze status" - } - }, - "setRequesterBlockStatus(address,uint256,address,bool)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "status": "Block status" - } - }, - "setWithdrawalLeadTime(address,uint32)": { - "params": { - "airnode": "Airnode address", - "withdrawalLeadTime": "Withdrawal lead time" - } - }, - "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" - } - }, - "updateDepositRequester(address,uint256,address,uint256,address,address)": { - "details": "This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time", - "params": { - "airnode": "Airnode address", - "chainIdNext": "Next chain ID", - "chainIdPrevious": "Previous chain ID", - "requesterNext": "Next requester address", - "requesterPrevious": "Previous requester address", - "token": "Token address" - } - }, - "withdrawToken(address,uint256,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - } - } - }, - "title": "Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "DEPOSITOR_FREEZER_ROLE_DESCRIPTION()": { - "notice": "Depositor freezer role description" - }, - "REQUESTER_BLOCKER_ROLE_DESCRIPTION()": { - "notice": "Requester blocker role description" - }, - "WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()": { - "notice": "Withdrawal lead time setter role description" - }, - "accessControlRegistry()": { - "notice": "AccessControlRegistry contract address" - }, - "adminRoleDescription()": { - "notice": "Admin role description" - }, - "airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)": { - "notice": "If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization." - }, - "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)": { - "notice": "Deposits of the token with the address made for the Airnode to authorize the requester address on the chain" - }, - "airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)": { - "notice": "Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain" - }, - "airnodeToDepositorToFreezeStatus(address,address)": { - "notice": "If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw." - }, - "airnodeToWithdrawalLeadTime(address)": { - "notice": "Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit." - }, - "deriveDepositorFreezerRole(address)": { - "notice": "Derives the depositor freezer role for the Airnode" - }, - "deriveRequesterBlockerRole(address)": { - "notice": "Derives the requester blocker role for the Airnode" - }, - "deriveWithdrawalLeadTimeSetterRole(address)": { - "notice": "Derives the withdrawal lead time setter role for the Airnode" - }, - "initiateTokenWithdrawal(address,uint256,address,address)": { - "notice": "Called by a token depositor to initiate withdrawal" - }, - "isAuthorized(address,uint256,address,address)": { - "notice": "Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited" - }, - "multicall(bytes[])": { - "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" - }, - "onERC721Received(address,address,uint256,bytes)": { - "notice": "Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester" - }, - "revokeToken(address,uint256,address,address,address)": { - "notice": "Called to revoke the token deposited to authorize a requester that is blocked now" - }, - "setDepositorFreezeStatus(address,address,bool)": { - "notice": "Called by the Airnode or its depositor freezers to set the freeze status of the depositor" - }, - "setRequesterBlockStatus(address,uint256,address,bool)": { - "notice": "Called by the Airnode or its requester blockers to set the block status of the requester" - }, - "setWithdrawalLeadTime(address,uint32)": { - "notice": "Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time" - }, - "tryMulticall(bytes[])": { - "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" - }, - "updateDepositRequester(address,uint256,address,uint256,address,address)": { - "notice": "Called by a token depositor to update the requester for which they have deposited the token for" - }, - "withdrawToken(address,uint256,address,address)": { - "notice": "Called by a token depositor to withdraw" - } - }, - "notice": "For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6427, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 13104, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))" - }, - { - "astId": 13110, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToWithdrawalLeadTime", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint32)" - }, - { - "astId": 13120, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToChainIdToRequesterToBlockStatus", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))" - }, - { - "astId": 13128, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToDepositorToFreezeStatus", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_enum(DepositState)14691": { - "encoding": "inplace", - "label": "enum IRequesterAuthorizerWithErc721.DepositState", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => mapping(address => bool)))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))" - }, - "t_mapping(t_address,t_struct(Deposit)13052_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct RequesterAuthorizerWithErc721.Deposit)", - "numberOfBytes": "32", - "value": "t_struct(Deposit)13052_storage" - }, - "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)", - "numberOfBytes": "32", - "value": "t_struct(TokenDeposits)13042_storage" - }, - "t_mapping(t_address,t_uint32)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Deposit)13052_storage": { - "encoding": "inplace", - "label": "struct RequesterAuthorizerWithErc721.Deposit", - "members": [ - { - "astId": 13044, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "tokenId", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 13046, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "withdrawalLeadTime", - "offset": 0, - "slot": "1", - "type": "t_uint32" - }, - { - "astId": 13048, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "earliestWithdrawalTime", - "offset": 4, - "slot": "1", - "type": "t_uint32" - }, - { - "astId": 13051, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "state", - "offset": 8, - "slot": "1", - "type": "t_enum(DepositState)14691" - } - ], - "numberOfBytes": "64" - }, - "t_struct(TokenDeposits)13042_storage": { - "encoding": "inplace", - "label": "struct RequesterAuthorizerWithErc721.TokenDeposits", - "members": [ - { - "astId": 13036, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "count", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 13041, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "depositorToDeposit", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_struct(Deposit)13052_storage)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/deployments/ethereum-sepolia-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/ethereum-sepolia-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/ethereum-sepolia-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/ethereum/AccessControlRegistry.json b/deployments/ethereum/AccessControlRegistry.json index c11a1163..017c39e3 100644 --- a/deployments/ethereum/AccessControlRegistry.json +++ b/deployments/ethereum/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x075cc410dc189cd7fe0cf352f0491ac9b1c5c53ce08a5ed80e66bbf6eea2e5ca", + "transactionHash": "0xec58b69cb8ec2df195952699c1af02f5f51fe329c549d9e511c8312d915ca675", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 107, - "gasUsed": "1720828", + "transactionIndex": 133, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0a3eaaf30c580dd6f1aa6db4d7f701f971b27a5b821feb6dcf9698a86c3122e9", - "transactionHash": "0x075cc410dc189cd7fe0cf352f0491ac9b1c5c53ce08a5ed80e66bbf6eea2e5ca", + "blockHash": "0x81378d85564ba235b9008e06d7366dfd60321be3ace1b30b97ca833b5f54ce8b", + "transactionHash": "0xec58b69cb8ec2df195952699c1af02f5f51fe329c549d9e511c8312d915ca675", "logs": [], - "blockNumber": 16841997, - "cumulativeGasUsed": "10923312", + "blockNumber": 18734505, + "cumulativeGasUsed": "12374412", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/ethereum/Api3ServerV1.json b/deployments/ethereum/Api3ServerV1.json index fd134907..dffa0606 100644 --- a/deployments/ethereum/Api3ServerV1.json +++ b/deployments/ethereum/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xf284fed6c689a1e321240b9ce466d1d3c892be48e334e1eaf588860f14840c76", + "transactionHash": "0x98e6653e6aad0ad4913eaf6b8b0adde58589b04d7b4156b960b6e4d83e43e041", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 115, - "gasUsed": "2960756", + "transactionIndex": 123, + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6a712eacb08d372efdffcc482e3ee60c9fc921e18f3f4d799c85ceb2e2287e39", - "transactionHash": "0xf284fed6c689a1e321240b9ce466d1d3c892be48e334e1eaf588860f14840c76", + "blockHash": "0xc5962d5e1f93dbf0a9c022ce17647c87750b6bd1bb96ca4d224ab6570a4025aa", + "transactionHash": "0x98e6653e6aad0ad4913eaf6b8b0adde58589b04d7b4156b960b6e4d83e43e041", "logs": [], - "blockNumber": 16842021, - "cumulativeGasUsed": "15800730", + "blockNumber": 18734506, + "cumulativeGasUsed": "14652445", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/ethereum/OrderPayable.json b/deployments/ethereum/OrderPayable.json index a23ea027..a169fc9c 100644 --- a/deployments/ethereum/OrderPayable.json +++ b/deployments/ethereum/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x33e936d7994721749ef66ea4006bb73b3ec7d66cb38b250c123e400020a8b4de", + "transactionHash": "0x6ea7926c8766957a10a1a4a6255129c62d9643b238d35869b57d92d48aa4934a", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 88, + "transactionIndex": 135, "gasUsed": "1235415", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xcd16f063a3aded2815b433871d01b1babd012e760c51d87d2d343e5862afdd80", - "transactionHash": "0x33e936d7994721749ef66ea4006bb73b3ec7d66cb38b250c123e400020a8b4de", + "blockHash": "0x3f4804621fe4f1c02fa93f2cef8f4e798408b6a7c9932ad3b6cf2b024659b61b", + "transactionHash": "0x6ea7926c8766957a10a1a4a6255129c62d9643b238d35869b57d92d48aa4934a", "logs": [], - "blockNumber": 17335203, - "cumulativeGasUsed": "7735258", + "blockNumber": 18735287, + "cumulativeGasUsed": "14918455", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "ecf9245e58f1f9a9d4c99f2f3b970cfc", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 12384, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/ethereum/PrepaymentDepository.json b/deployments/ethereum/PrepaymentDepository.json deleted file mode 100644 index 1dabb1d3..00000000 --- a/deployments/ethereum/PrepaymentDepository.json +++ /dev/null @@ -1,967 +0,0 @@ -{ - "address": "0x8367a2a08e46e0BA57CF1a24412E5AF7b4236D93", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_accessControlRegistry", - "type": "address" - }, - { - "internalType": "string", - "name": "_adminRoleDescription", - "type": "string" - }, - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Claimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DecreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "IncreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "SetWithdrawalDestination", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "name": "Withdrew", - "type": "event" - }, - { - "inputs": [], - "name": "CLAIMER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WITHDRAWAL_SIGNER_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": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "applyPermitAndDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "decreaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "increaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "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": "user", - "type": "address" - }, - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "setWithdrawalDestination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalDestination", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitDecreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitIncreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "withdraw", - "outputs": [ - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalSignerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "withdrawalWithHashIsExecuted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x7e3f8064548b88c09716ff86c082f9485acb386d53d5e3fb134104ed50caf267", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 131, - "gasUsed": "2040931", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x56f2fbc03eaddde2ccdde774eac4b216c0f6297cb043772050091344816033fa", - "transactionHash": "0x7e3f8064548b88c09716ff86c082f9485acb386d53d5e3fb134104ed50caf267", - "logs": [], - "blockNumber": 17173868, - "cumulativeGasUsed": "12331830", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "PrepaymentDepository admin (OEV Relay)", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" - ], - "numDeployments": 1, - "solcInputHash": "8120b0965e5841e9c149e38a1b41bcef", - "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\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"DecreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"IncreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"SetWithdrawalDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLAIMER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_SIGNER_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\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"applyPermitAndDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"decreaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"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\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"setWithdrawalDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitDecreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitIncreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalSignerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"withdrawalWithHashIsExecuted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"deadline\":\"Deadline of the permit\",\"r\":\"r component of the signature\",\"s\":\"s component of the signature\",\"user\":\"User address\",\"v\":\"v component of the signature\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"claim(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to claim\",\"recipient\":\"Recipient address\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\",\"_token\":\"Contract address of the ERC20 token that prepayments are made in\"}},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"params\":{\"amount\":\"Amount to decrease the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Decreased withdrawal limit\"}},\"deposit(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"increaseUserWithdrawalLimit(address,uint256)\":{\"details\":\"This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls\",\"params\":{\"amount\":\"Amount to increase the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"setWithdrawalDestination(address,address)\":{\"params\":{\"user\":\"User address\",\"withdrawalDestination\":\"Withdrawal destination\"}},\"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(uint256,uint256,address,bytes)\":{\"params\":{\"amount\":\"Amount of tokens to withdraw\",\"expirationTimestamp\":\"Expiration timestamp of the signature\",\"signature\":\"Withdrawal signature\",\"withdrawalSigner\":\"Address of the account that signed the withdrawal\"},\"returns\":{\"withdrawalDestination\":\"Withdrawal destination\",\"withdrawalLimit\":\"Decreased withdrawal limit\"}}},\"title\":\"Contract that enables micropayments to be prepaid in batch\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"CLAIMER_ROLE_DESCRIPTION()\":{\"notice\":\"Claimer role description\"},\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit decreaser role description\"},\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit increaser role description\"},\"WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal signer role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"notice\":\"Called to apply a ERC2612 permit and deposit tokens on behalf of a user\"},\"claim(address,uint256)\":{\"notice\":\"Called to claim tokens\"},\"claimerRole()\":{\"notice\":\"Claimer role\"},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to decrease the withdrawal limit of the user\"},\"deposit(address,uint256)\":{\"notice\":\"Called to deposit tokens on behalf of a user\"},\"increaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to increase the withdrawal limit of the user\"},\"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\"},\"setWithdrawalDestination(address,address)\":{\"notice\":\"Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination\"},\"token()\":{\"notice\":\"Contract address of the ERC20 token that prepayments can be made in\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"userToWithdrawalDestination(address)\":{\"notice\":\"Returns the withdrawal destination of the user\"},\"userToWithdrawalLimit(address)\":{\"notice\":\"Returns the withdrawal limit of the user\"},\"userWithdrawalLimitDecreaserRole()\":{\"notice\":\"User withdrawal limit decreaser role\"},\"userWithdrawalLimitIncreaserRole()\":{\"notice\":\"User withdrawal limit increaser role\"},\"withdraw(uint256,uint256,address,bytes)\":{\"notice\":\"Called by a user to withdraw tokens\"},\"withdrawalSignerRole()\":{\"notice\":\"Withdrawal signer role\"},\"withdrawalWithHashIsExecuted(bytes32)\":{\"notice\":\"Returns if the withdrawal with the hash is executed\"}},\"notice\":\"`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/PrepaymentDepository.sol\":\"PrepaymentDepository\"},\"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/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/PrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./interfaces/IPrepaymentDepository.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\n/// @title Contract that enables micropayments to be prepaid in batch\\n/// @notice `manager` represents the payment recipient, and its various\\n/// privileges can be delegated to other accounts through respective roles.\\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\\n/// be granted to a multisig or an equivalently decentralized account.\\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\\n/// being compromised poses a risk in proportion to the redundancy in user\\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\\n/// withdrawal limits as necessary to mitigate this risk.\\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\\n/// cannot cause irreversible harm.\\n/// This contract accepts prepayments in an ERC20 token specified immutably\\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\\n/// An optional `depositWithPermit()` function is added to provide ERC2612\\n/// support.\\ncontract PrepaymentDepository is\\n AccessControlRegistryAdminnedWithManager,\\n IPrepaymentDepository\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Withdrawal signer role description\\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\\n \\\"Withdrawal signer\\\";\\n /// @notice User withdrawal limit increaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit increaser\\\";\\n /// @notice User withdrawal limit decreaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit decreaser\\\";\\n /// @notice Claimer role description\\n string public constant override CLAIMER_ROLE_DESCRIPTION = \\\"Claimer\\\";\\n\\n // We prefer revert strings over custom errors because not all chains and\\n // block explorers support custom errors\\n string private constant AMOUNT_ZERO_REVERT_STRING = \\\"Amount zero\\\";\\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\\n \\\"Amount exceeds limit\\\";\\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\\n \\\"Transfer unsuccessful\\\";\\n\\n /// @notice Withdrawal signer role\\n bytes32 public immutable override withdrawalSignerRole;\\n /// @notice User withdrawal limit increaser role\\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\\n /// @notice User withdrawal limit decreaser role\\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\\n /// @notice Claimer role\\n bytes32 public immutable override claimerRole;\\n\\n /// @notice Contract address of the ERC20 token that prepayments can be\\n /// made in\\n address public immutable override token;\\n\\n /// @notice Returns the withdrawal destination of the user\\n mapping(address => address) public userToWithdrawalDestination;\\n\\n /// @notice Returns the withdrawal limit of the user\\n mapping(address => uint256) public userToWithdrawalLimit;\\n\\n /// @notice Returns if the withdrawal with the hash is executed\\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\\n\\n /// @param user User address\\n /// @param amount Amount\\n /// @dev Reverts if user address or amount is zero\\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\\n require(user != address(0), \\\"User address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n _;\\n }\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n /// @param _token Contract address of the ERC20 token that prepayments are\\n /// made in\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager,\\n address _token\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n require(_token != address(0), \\\"Token address zero\\\");\\n token = _token;\\n withdrawalSignerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitIncreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitDecreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\\n );\\n claimerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n CLAIMER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Called by the user that has not set a withdrawal destination to\\n /// set a withdrawal destination, or called by the withdrawal destination\\n /// of a user to set a new withdrawal destination\\n /// @param user User address\\n /// @param withdrawalDestination Withdrawal destination\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external override {\\n require(user != withdrawalDestination, \\\"Same user and destination\\\");\\n require(\\n (msg.sender == user &&\\n userToWithdrawalDestination[user] == address(0)) ||\\n (msg.sender == userToWithdrawalDestination[user]),\\n \\\"Sender not destination\\\"\\n );\\n userToWithdrawalDestination[user] = withdrawalDestination;\\n emit SetWithdrawalDestination(user, withdrawalDestination);\\n }\\n\\n /// @notice Called to increase the withdrawal limit of the user\\n /// @dev This function is intended to be used to revert faulty\\n /// `decreaseUserWithdrawalLimit()` calls\\n /// @param user User address\\n /// @param amount Amount to increase the withdrawal limit by\\n /// @return withdrawalLimit Increased withdrawal limit\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitIncreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot increase withdrawal limit\\\"\\n );\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit IncreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to decrease the withdrawal limit of the user\\n /// @param user User address\\n /// @param amount Amount to decrease the withdrawal limit by\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitDecreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot decrease withdrawal limit\\\"\\n );\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit DecreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to claim tokens\\n /// @param recipient Recipient address\\n /// @param amount Amount of tokens to claim\\n function claim(address recipient, uint256 amount) external override {\\n require(recipient != address(0), \\\"Recipient address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n claimerRole,\\n msg.sender\\n ),\\n \\\"Cannot claim\\\"\\n );\\n emit Claimed(recipient, amount, msg.sender);\\n require(\\n IERC20(token).transfer(recipient, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to deposit tokens on behalf of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @return withdrawalLimit Increased withdrawal limit\\n function deposit(\\n address user,\\n uint256 amount\\n )\\n public\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\\n require(\\n IERC20(token).transferFrom(msg.sender, address(this), amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\\n /// of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @param deadline Deadline of the permit\\n /// @param v v component of the signature\\n /// @param r r component of the signature\\n /// @param s s component of the signature\\n /// @return withdrawalLimit Increased withdrawal limit\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external override returns (uint256 withdrawalLimit) {\\n IERC20Permit(token).permit(\\n msg.sender,\\n address(this),\\n amount,\\n deadline,\\n v,\\n r,\\n s\\n );\\n withdrawalLimit = deposit(user, amount);\\n }\\n\\n /// @notice Called by a user to withdraw tokens\\n /// @param amount Amount of tokens to withdraw\\n /// @param expirationTimestamp Expiration timestamp of the signature\\n /// @param withdrawalSigner Address of the account that signed the\\n /// withdrawal\\n /// @param signature Withdrawal signature\\n /// @return withdrawalDestination Withdrawal destination\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n )\\n external\\n override\\n returns (address withdrawalDestination, uint256 withdrawalLimit)\\n {\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(block.timestamp < expirationTimestamp, \\\"Signature expired\\\");\\n bytes32 withdrawalHash = keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n msg.sender,\\n amount,\\n expirationTimestamp\\n )\\n );\\n require(\\n !withdrawalWithHashIsExecuted[withdrawalHash],\\n \\\"Withdrawal already executed\\\"\\n );\\n require(\\n withdrawalSigner == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n withdrawalSignerRole,\\n withdrawalSigner\\n ),\\n \\\"Cannot sign withdrawal\\\"\\n );\\n require(\\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\\n withdrawalSigner,\\n \\\"Signature mismatch\\\"\\n );\\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\\n withdrawalDestination = msg.sender;\\n } else {\\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\\n }\\n emit Withdrew(\\n msg.sender,\\n withdrawalHash,\\n amount,\\n expirationTimestamp,\\n withdrawalSigner,\\n withdrawalDestination,\\n withdrawalLimit\\n );\\n require(\\n IERC20(token).transfer(withdrawalDestination, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n}\\n\",\"keccak256\":\"0x74314a7fbed41c4bb318a24b7c2cb104f2fea2211f43d03f76aead2ad3858052\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IPrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\\n event SetWithdrawalDestination(\\n address indexed user,\\n address withdrawalDestination\\n );\\n\\n event IncreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event DecreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Claimed(address recipient, uint256 amount, address sender);\\n\\n event Deposited(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Withdrew(\\n address indexed user,\\n bytes32 indexed withdrawalHash,\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n address withdrawalDestination,\\n uint256 withdrawalLimit\\n );\\n\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external;\\n\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function claim(address recipient, uint256 amount) external;\\n\\n function deposit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external returns (uint256 withdrawalLimit);\\n\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\\n\\n function withdrawalSignerRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\\n\\n function claimerRole() external view returns (bytes32);\\n\\n function token() external view returns (address);\\n}\\n\",\"keccak256\":\"0x15ec7b40b9be1ea7ca88b39d6a8a5a94f213977565c6b754ad4b2f5ffb7b9710\",\"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": "0x6101a06040523480156200001257600080fd5b50604051620029e2380380620029e2833981016040819052620000359162000468565b83838382826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620005ea565b50806040516020016200010b9190620006b6565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000326565b60e0525050506001600160a01b038116620001eb5760405162461bcd60e51b8152602060048201526012602482015271546f6b656e2061646472657373207a65726f60701b604482015260640162000080565b6001600160a01b0381166101805260c0516200023a906200020c9062000326565b6040805180820190915260118152702bb4ba34323930bbb0b61039b4b3b732b960791b6020820152620003a0565b6101005260c0516200028b90620002519062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420696e63726561736572006020820152620003a0565b6101205260c051620002dc90620002a29062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420646563726561736572006020820152620003a0565b6101405260c0516200031790620002f39062000326565b60408051808201909152600781526621b630b4b6b2b960c91b6020820152620003a0565b6101605250620006d492505050565b60006200039a6200036b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620003dc8383604051602001620003ba9190620006b6565b60405160208183030381529060405280519060200120620003e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200042757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200045f57818101518382015260200162000445565b50506000910152565b600080600080608085870312156200047f57600080fd5b6200048a856200040f565b60208601519094506001600160401b0380821115620004a857600080fd5b818701915087601f830112620004bd57600080fd5b815181811115620004d257620004d26200042c565b604051601f8201601f19908116603f01168101908382118183101715620004fd57620004fd6200042c565b816040528281528a60208487010111156200051757600080fd5b6200052a83602083016020880162000442565b809750505050505062000540604086016200040f565b915062000550606086016200040f565b905092959194509250565b600181811c908216806200057057607f821691505b6020821081036200059157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005e557600081815260208120601f850160051c81016020861015620005c05750805b601f850160051c820191505b81811015620005e157828155600101620005cc565b5050505b505050565b81516001600160401b038111156200060657620006066200042c565b6200061e816200061784546200055b565b8462000597565b602080601f8311600181146200065657600084156200063d5750858301515b600019600386901b1c1916600185901b178555620005e1565b600085815260208120601f198616915b82811015620006875788860151825594840194600190910190840162000666565b5085821015620006a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620006ca81846020870162000442565b9190910192915050565b60805160a05160c05160e0516101005161012051610140516101605161018051612230620007b2600039600081816105500152818161082b01528181610c8901528181610f3301526119d70152600081816103fd0152610dda0152600081816101e60152610a5b015260008181610367015261124a0152600081816103a101526116e4015260006101ac0152600081816102fc01528181610a2501528181610da401528181611214015261169c0152600050506000818161024001528181610a8701528181610e0601528181611276015261171a01526122306000f3fe608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "params": { - "amount": "Amount of tokens to deposit", - "deadline": "Deadline of the permit", - "r": "r component of the signature", - "s": "s component of the signature", - "user": "User address", - "v": "v component of the signature" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "claim(address,uint256)": { - "params": { - "amount": "Amount of tokens to claim", - "recipient": "Recipient address" - } - }, - "constructor": { - "params": { - "_accessControlRegistry": "AccessControlRegistry contract address", - "_adminRoleDescription": "Admin role description", - "_manager": "Manager address", - "_token": "Contract address of the ERC20 token that prepayments are made in" - } - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "params": { - "amount": "Amount to decrease the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Decreased withdrawal limit" - } - }, - "deposit(address,uint256)": { - "params": { - "amount": "Amount of tokens to deposit", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "details": "This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls", - "params": { - "amount": "Amount to increase the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "multicall(bytes[])": { - "params": { - "data": "Array of calldata of batched calls" - }, - "returns": { - "returndata": "Array of returndata of batched calls" - } - }, - "setWithdrawalDestination(address,address)": { - "params": { - "user": "User address", - "withdrawalDestination": "Withdrawal destination" - } - }, - "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(uint256,uint256,address,bytes)": { - "params": { - "amount": "Amount of tokens to withdraw", - "expirationTimestamp": "Expiration timestamp of the signature", - "signature": "Withdrawal signature", - "withdrawalSigner": "Address of the account that signed the withdrawal" - }, - "returns": { - "withdrawalDestination": "Withdrawal destination", - "withdrawalLimit": "Decreased withdrawal limit" - } - } - }, - "title": "Contract that enables micropayments to be prepaid in batch", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "CLAIMER_ROLE_DESCRIPTION()": { - "notice": "Claimer role description" - }, - "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit decreaser role description" - }, - "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit increaser role description" - }, - "WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()": { - "notice": "Withdrawal signer role description" - }, - "accessControlRegistry()": { - "notice": "AccessControlRegistry contract address" - }, - "adminRole()": { - "notice": "Admin role" - }, - "adminRoleDescription()": { - "notice": "Admin role description" - }, - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "notice": "Called to apply a ERC2612 permit and deposit tokens on behalf of a user" - }, - "claim(address,uint256)": { - "notice": "Called to claim tokens" - }, - "claimerRole()": { - "notice": "Claimer role" - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to decrease the withdrawal limit of the user" - }, - "deposit(address,uint256)": { - "notice": "Called to deposit tokens on behalf of a user" - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to increase the withdrawal limit of the user" - }, - "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" - }, - "setWithdrawalDestination(address,address)": { - "notice": "Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination" - }, - "token()": { - "notice": "Contract address of the ERC20 token that prepayments can be made in" - }, - "tryMulticall(bytes[])": { - "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" - }, - "userToWithdrawalDestination(address)": { - "notice": "Returns the withdrawal destination of the user" - }, - "userToWithdrawalLimit(address)": { - "notice": "Returns the withdrawal limit of the user" - }, - "userWithdrawalLimitDecreaserRole()": { - "notice": "User withdrawal limit decreaser role" - }, - "userWithdrawalLimitIncreaserRole()": { - "notice": "User withdrawal limit increaser role" - }, - "withdraw(uint256,uint256,address,bytes)": { - "notice": "Called by a user to withdraw tokens" - }, - "withdrawalSignerRole()": { - "notice": "Withdrawal signer role" - }, - "withdrawalWithHashIsExecuted(bytes32)": { - "notice": "Returns if the withdrawal with the hash is executed" - } - }, - "notice": "`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 3798, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 13434, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalDestination", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_address)" - }, - { - "astId": 13439, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalLimit", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 13444, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "withdrawalWithHashIsExecuted", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_address)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/deployments/ethereum/ProxyFactory.json b/deployments/ethereum/ProxyFactory.json index 89616cd5..2423e522 100644 --- a/deployments/ethereum/ProxyFactory.json +++ b/deployments/ethereum/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xb484311bc9e7956022dfe9932bcd8028e3fa90f58b3eaa50c54e4f5f531b4be2", + "transactionHash": "0x190b2248fa596ef6d95423d249dca7c91bcfd70149fca4de0bcf8f3e30f8ecba", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 68, - "gasUsed": "1472737", + "transactionIndex": 22, + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf06dd99064b5af369587aa640f0ffbf9bcc4412ee6844315d20ff195fb90a8f4", - "transactionHash": "0xb484311bc9e7956022dfe9932bcd8028e3fa90f58b3eaa50c54e4f5f531b4be2", + "blockHash": "0x89d03222e1c58d7a6bb645e4b00c81e26f2283b698f9774bf078797fb3f248cc", + "transactionHash": "0x190b2248fa596ef6d95423d249dca7c91bcfd70149fca4de0bcf8f3e30f8ecba", "logs": [], - "blockNumber": 16842033, - "cumulativeGasUsed": "7132742", + "blockNumber": 18734507, + "cumulativeGasUsed": "4528615", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/ethereum/RequesterAuthorizerWithErc721.json b/deployments/ethereum/RequesterAuthorizerWithErc721.json deleted file mode 100644 index fc8e0f6b..00000000 --- a/deployments/ethereum/RequesterAuthorizerWithErc721.json +++ /dev/null @@ -1,1489 +0,0 @@ -{ - "address": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_accessControlRegistry", - "type": "address" - }, - { - "internalType": "string", - "name": "_adminRoleDescription", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "DepositedToken", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "InitiatedTokenWithdrawal", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "RevokedToken", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "status", - "type": "bool" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetDepositorFreezeStatus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "status", - "type": "bool" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetRequesterBlockStatus", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SetWithdrawalLeadTime", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "UpdatedDepositRequesterFrom", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "UpdatedDepositRequesterTo", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenDepositCount", - "type": "uint256" - } - ], - "name": "WithdrewToken", - "type": "event" - }, - { - "inputs": [], - "name": "DEPOSITOR_FREEZER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "REQUESTER_BLOCKER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WITHDRAWAL_LEAD_TIME_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": "adminRoleDescription", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToBlockStatus", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits", - "outputs": [ - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "airnodeToChainIdToRequesterToTokenToDepositorToDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - }, - { - "internalType": "enum IRequesterAuthorizerWithErc721.DepositState", - "name": "state", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToDepositorToFreezeStatus", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "airnodeToWithdrawalLeadTime", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveDepositorFreezerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "depositorFreezerRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveRequesterBlockerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "requesterBlockerRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - } - ], - "name": "deriveWithdrawalLeadTimeSetterRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "withdrawalLeadTimeSetterRole", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "initiateTokenWithdrawal", - "outputs": [ - { - "internalType": "uint32", - "name": "earliestWithdrawalTime", - "type": "uint32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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" - }, - { - "internalType": "address", - "name": "_from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - } - ], - "name": "revokeToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "address", - "name": "depositor", - "type": "address" - }, - { - "internalType": "bool", - "name": "status", - "type": "bool" - } - ], - "name": "setDepositorFreezeStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "bool", - "name": "status", - "type": "bool" - } - ], - "name": "setRequesterBlockStatus", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint32", - "name": "withdrawalLeadTime", - "type": "uint32" - } - ], - "name": "setWithdrawalLeadTime", - "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": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainIdPrevious", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requesterPrevious", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainIdNext", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requesterNext", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "updateDepositRequester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "airnode", - "type": "address" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "requester", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "withdrawToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x0f069850046f9617dff155dd7b122c24903de40e1fb83ecb08a961be1854571e", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 94, - "gasUsed": "2698635", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x204b2b22fcb2e1927ec6f9f2ff6e8fc311de69726d5f6b1d5145be0e6c212228", - "transactionHash": "0x0f069850046f9617dff155dd7b122c24903de40e1fb83ecb08a961be1854571e", - "logs": [], - "blockNumber": 17272385, - "cumulativeGasUsed": "15675075", - "status": 1, - "byzantium": true - }, - "args": ["0x12D82f38a038A71b0843BD3256CD1E0A1De74834", "RequesterAuthorizerWithErc721 admin"], - "numDeployments": 1, - "solcInputHash": "f2801ef4a5bbfe0372728f499155ff5d", - "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\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"DepositedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"InitiatedTokenWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"RevokedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDepositorFreezeStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetRequesterBlockStatus\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetWithdrawalLeadTime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterFrom\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"UpdatedDepositRequesterTo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenDepositCount\",\"type\":\"uint256\"}],\"name\":\"WithdrewToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REQUESTER_BLOCKER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_LEAD_TIME_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\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToBlockStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"},{\"internalType\":\"enum IRequesterAuthorizerWithErc721.DepositState\",\"name\":\"state\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToDepositorToFreezeStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"airnodeToWithdrawalLeadTime\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveDepositorFreezerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"depositorFreezerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveRequesterBlockerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"requesterBlockerRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"}],\"name\":\"deriveWithdrawalLeadTimeSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"withdrawalLeadTimeSetterRole\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"initiateTokenWithdrawal\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"earliestWithdrawalTime\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\"},{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"}],\"name\":\"revokeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setDepositorFreezeStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setRequesterBlockStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"withdrawalLeadTime\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalLeadTime\",\"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\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdPrevious\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterPrevious\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainIdNext\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requesterNext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"updateDepositRequester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"requester\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"withdrawToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.\",\"kind\":\"dev\",\"methods\":{\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\",\"tokenId\":\"Token ID\",\"withdrawalLeadTime\":\"Withdrawal lead time captured at deposit-time\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\"}},\"deriveDepositorFreezerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"depositorFreezerRole\":\"Depositor freezer role\"}},\"deriveRequesterBlockerRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"requesterBlockerRole\":\"Requester blocker role\"}},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"params\":{\"airnode\":\"Airnode address\"},\"returns\":{\"withdrawalLeadTimeSetterRole\":\"Withdrawal lead time setter role\"}},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"details\":\"The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.\",\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"earliestWithdrawalTime\":\"Earliest withdrawal time\"}},\"isAuthorized(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"},\"returns\":{\"_0\":\"Authorization status\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"The first argument is the operator, which we do not need\",\"params\":{\"_data\":\"Airnode address, chain ID and requester address in ABI-encoded form\",\"_from\":\"Account from which the token is transferred\",\"_tokenId\":\"Token ID\"},\"returns\":{\"_0\":\"`onERC721Received()` function selector\"}},\"revokeToken(address,uint256,address,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"depositor\":\"Depositor address\",\"requester\":\"Requester address\",\"token\":\"Token address\"}},\"setDepositorFreezeStatus(address,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"depositor\":\"Depositor address\",\"status\":\"Freeze status\"}},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"status\":\"Block status\"}},\"setWithdrawalLeadTime(address,uint32)\":{\"params\":{\"airnode\":\"Airnode address\",\"withdrawalLeadTime\":\"Withdrawal lead time\"}},\"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\"}},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"details\":\"This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time\",\"params\":{\"airnode\":\"Airnode address\",\"chainIdNext\":\"Next chain ID\",\"chainIdPrevious\":\"Previous chain ID\",\"requesterNext\":\"Next requester address\",\"requesterPrevious\":\"Previous requester address\",\"token\":\"Token address\"}},\"withdrawToken(address,uint256,address,address)\":{\"params\":{\"airnode\":\"Airnode address\",\"chainId\":\"Chain ID\",\"requester\":\"Requester address\",\"token\":\"Token address\"}}},\"title\":\"Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DEPOSITOR_FREEZER_ROLE_DESCRIPTION()\":{\"notice\":\"Depositor freezer role description\"},\"REQUESTER_BLOCKER_ROLE_DESCRIPTION()\":{\"notice\":\"Requester blocker role description\"},\"WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal lead time setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)\":{\"notice\":\"If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization.\"},\"airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)\":{\"notice\":\"Deposits of the token with the address made for the Airnode to authorize the requester address on the chain\"},\"airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)\":{\"notice\":\"Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain\"},\"airnodeToDepositorToFreezeStatus(address,address)\":{\"notice\":\"If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw.\"},\"airnodeToWithdrawalLeadTime(address)\":{\"notice\":\"Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit.\"},\"deriveDepositorFreezerRole(address)\":{\"notice\":\"Derives the depositor freezer role for the Airnode\"},\"deriveRequesterBlockerRole(address)\":{\"notice\":\"Derives the requester blocker role for the Airnode\"},\"deriveWithdrawalLeadTimeSetterRole(address)\":{\"notice\":\"Derives the withdrawal lead time setter role for the Airnode\"},\"initiateTokenWithdrawal(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to initiate withdrawal\"},\"isAuthorized(address,uint256,address,address)\":{\"notice\":\"Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"onERC721Received(address,address,uint256,bytes)\":{\"notice\":\"Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester\"},\"revokeToken(address,uint256,address,address,address)\":{\"notice\":\"Called to revoke the token deposited to authorize a requester that is blocked now\"},\"setDepositorFreezeStatus(address,address,bool)\":{\"notice\":\"Called by the Airnode or its depositor freezers to set the freeze status of the depositor\"},\"setRequesterBlockStatus(address,uint256,address,bool)\":{\"notice\":\"Called by the Airnode or its requester blockers to set the block status of the requester\"},\"setWithdrawalLeadTime(address,uint32)\":{\"notice\":\"Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateDepositRequester(address,uint256,address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to update the requester for which they have deposited the token for\"},\"withdrawToken(address,uint256,address,address)\":{\"notice\":\"Called by a token depositor to withdraw\"}},\"notice\":\"For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/authorizers/RequesterAuthorizerWithErc721.sol\":\"RequesterAuthorizerWithErc721\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xab28a56179c1db258c9bf5235b382698cb650debecb51b23d12be9e241374b68\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"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/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/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/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/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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/authorizers/RequesterAuthorizerWithErc721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/metatx/ERC2771Context.sol\\\";\\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 ERC2771Context,\\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 ERC2771Context(_accessControlRegistry)\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveWithdrawalLeadTimeSetterRole(airnode),\\n _msgSender()\\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, _msgSender());\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveRequesterBlockerRole(airnode),\\n _msgSender()\\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 _msgSender()\\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 == _msgSender() ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n deriveDepositorFreezerRole(airnode),\\n _msgSender()\\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, _msgSender());\\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][_msgSender()];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainIdPrevious][requesterPrevious][token];\\n Deposit\\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\\n .depositorToDeposit[_msgSender()];\\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[_msgSender()].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[_msgSender()] = Deposit({\\n tokenId: tokenId,\\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Active\\n });\\n requesterPreviousTokenDeposits.depositorToDeposit[\\n _msgSender()\\n ] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit UpdatedDepositRequesterTo(\\n airnode,\\n requesterNext,\\n _msgSender(),\\n chainIdNext,\\n token,\\n tokenId,\\n requesterNextTokenDepositCount\\n );\\n emit UpdatedDepositRequesterFrom(\\n airnode,\\n requesterPrevious,\\n _msgSender(),\\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[\\n _msgSender()\\n ];\\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 _msgSender(),\\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][_msgSender()],\\n \\\"Depositor frozen\\\"\\n );\\n TokenDeposits\\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\\n airnode\\n ][chainId][requester][token];\\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\\n _msgSender()\\n ];\\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[_msgSender()] = Deposit({\\n tokenId: 0,\\n withdrawalLeadTime: 0,\\n earliestWithdrawalTime: 0,\\n state: DepositState.Inactive\\n });\\n emit WithdrewToken(\\n airnode,\\n requester,\\n _msgSender(),\\n chainId,\\n token,\\n tokenId,\\n tokenDepositCount\\n );\\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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\",\"keccak256\":\"0xbcc385f2ec8c01559b2b00c6b21184a152a024b5c66d321b33d13a48d656f385\",\"license\":\"MIT\"},\"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\",\"keccak256\":\"0xb7ef76aef8e6246717d9447c9b12030c59ee58cf77126f711b62c8cd935efc6f\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x60e06040523480156200001157600080fd5b506040516200326538038062003265833981016040819052620000349162000170565b6001600160a01b0382166080819052829082906200008c5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000df5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000083565b6001600160a01b03821660a0526000620000fa8282620002da565b50806040516020016200010e9190620003a6565b60408051601f19818403018152919052805160209091012060c05250620003c492505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620001675781810151838201526020016200014d565b50506000910152565b600080604083850312156200018457600080fd5b82516001600160a01b03811681146200019c57600080fd5b60208401519092506001600160401b0380821115620001ba57600080fd5b818501915085601f830112620001cf57600080fd5b815181811115620001e457620001e462000134565b604051601f8201601f19908116603f011681019083821181831017156200020f576200020f62000134565b816040528281528860208487010111156200022957600080fd5b6200023c8360208301602088016200014a565b80955050505050509250929050565b600181811c908216806200026057607f821691505b6020821081036200028157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d557600081815260208120601f850160051c81016020861015620002b05750805b601f850160051c820191505b81811015620002d157828155600101620002bc565b5050505b505050565b81516001600160401b03811115620002f657620002f662000134565b6200030e816200030784546200024b565b8462000287565b602080601f8311600181146200034657600084156200032d5750858301515b600019600386901b1c1916600185901b178555620002d1565b600085815260208120601f198616915b82811015620003775788860151825594840194600190910190840162000356565b5085821015620003965787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620003ba8184602087016200014a565b9190910192915050565b60805160a05160c051612e556200041060003960006126c801526000818161022e01528181610a7501528181610edd0152611ffc01526000818161030d01526126310152612e556000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80636a7de695116100ee578063ac9650d811610097578063cf46678a11610071578063cf46678a1461056e578063d0e463a014610581578063ed37a52114610594578063ed56e83c146105a757600080fd5b8063ac9650d814610528578063b2fe25d114610548578063bc1d287d1461055b57600080fd5b80638a2728a1116100c85780638a2728a11461047c57806390a1a23b146104b8578063a2b7719a146104ec57600080fd5b80636a7de6951461039f5780636d8d4d891461042f5780637fcc47361461044257600080fd5b8063482f3975116101505780635eab4f9a1161012a5780635eab4f9a1461033d578063619d7fa814610350578063691376521461037e57600080fd5b8063482f3975146102ac5780634c8f1d8d146102f5578063572b6c05146102fd57600080fd5b80631ce9ae07116101815780631ce9ae071461022957806328cd8b2e14610268578063437b91161461028b57600080fd5b806310cc23ba146101a8578063150b7a02146101e85780631a126f1a14610214575b600080fd5b6101ce6101b636600461279c565b60026020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b6101fb6101f63660046127c0565b6105ba565b6040516001600160e01b031990911681526020016101df565b61022761022236600461285f565b610a51565b005b6102507f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101df565b61027b6102763660046128a1565b610c46565b60405190151581526020016101df565b61029e6102993660046128f4565b610cc5565b6040516101df929190612a0e565b6102e86040518060400160405280601181526020017f4465706f7369746f7220667265657a657200000000000000000000000000000081525081565b6040516101df9190612a67565b6102e8610e2b565b61027b61030b36600461279c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61022761034b366004612a88565b610eb9565b61027b61035e366004612ad0565b600460209081526000928352604080842090915290825290205460ff1681565b61039161038c36600461279c565b6110ff565b6040519081526020016101df565b61041f6103ad366004612afe565b6001600160a01b03948516600090815260016020818152604080842097845296815286832095881683529485528582209387168252928452848120919095168552810190915291208054910154909163ffffffff80831692640100000000810490911691600160401b90910460ff1690565b6040516101df9493929190612b7c565b61039161043d36600461279c565b611197565b6103916104503660046128a1565b600160209081526000948552604080862082529385528385208152918452828420909152825290205481565b6102e86040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d6520736574746572000000000081525081565b61027b6104c6366004612bc4565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b6102e86040518060400160405280601181526020017f52657175657374657220626c6f636b657200000000000000000000000000000081525081565b61053b6105363660046128f4565b6111eb565b6040516101df9190612c06565b610227610556366004612c19565b61136c565b61039161056936600461279c565b611a74565b61022761057c366004612afe565b611ac8565b6101ce61058f3660046128a1565b611dbe565b6102276105a2366004612c89565b611fd8565b6102276105b53660046128a1565b6121cf565b6000606082146106115760405162461bcd60e51b815260206004820152601660248201527f556e65787065637465642064617461206c656e6774680000000000000000000060448201526064015b60405180910390fd5b6000808061062185870187612bc4565b919450925090506001600160a01b03831661067e5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610608565b816000036106be5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0381166107145760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b03808416600090815260036020908152604080832086845282528083209385168352929052205460ff16156107925760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b038084166000908152600460209081526040808320938c168352929052205460ff16156107fb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b038084166000908152600160209081526040808320868452825280832093851683529290529081208161083361262d565b6001600160a01b03168152602081019190915260400160009081208054600101808255909250906001600160a01b038b166000908152600184810160205260409091200154600160401b900460ff16600281111561089357610893612b66565b146108e05760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b604080516080810182528a81526001600160a01b0387166000908152600260209081528382205463ffffffff16908301529181019190915260608101600190526001600160a01b038b16600090815260018085016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b8360028111156109a3576109a3612b66565b0217905550905050896001600160a01b0316836001600160a01b0316866001600160a01b03167f733c0f83c361174d76ad99d0165c72fec3f3780aed76ef16dc2733f8864fd3c4876109f361262d565b604080519283526001600160a01b03909116602083015281018e90526060810186905260800160405180910390a4507f150b7a02000000000000000000000000000000000000000000000000000000009a9950505050505050505050565b610a5961262d565b6001600160a01b0316826001600160a01b03161480610b2157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610aab846110ff565b610ab361262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b219190612cc9565b610b6d5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f7420736574206c6561642074696d6500000000006044820152606401610608565b62278d008163ffffffff161115610bc65760405162461bcd60e51b815260206004820152601260248201527f4c6561642074696d6520746f6f206c6f6e6700000000000000000000000000006044820152606401610608565b6001600160a01b0382166000818152600260205260409020805463ffffffff191663ffffffff84161790557f461885426a8ca6cc3a301f29008e2424cb0cc663f8a5e8da1245385521d7ca8e82610c1b61262d565b6040805163ffffffff90931683526001600160a01b0390911660208301520160405180910390a25050565b6001600160a01b038085166000908152600360209081526040808320878452825280832093861683529290529081205460ff16158015610cbc57506001600160a01b0380861660009081526001602090815260408083208884528252808320878516845282528083209386168352929052205415155b95945050505050565b606080828067ffffffffffffffff811115610ce257610ce2612ce6565b604051908082528060200260200182016040528015610d0b578160200160208202803683370190505b5092508067ffffffffffffffff811115610d2757610d27612ce6565b604051908082528060200260200182016040528015610d5a57816020015b6060815260200190600190039081610d455790505b50915060005b81811015610e225730868683818110610d7b57610d7b612cfc565b9050602002810190610d8d9190612d12565b604051610d9b929190612d60565b600060405180830381855af49150503d8060008114610dd6576040519150601f19603f3d011682016040523d82523d6000602084013e610ddb565b606091505b50858381518110610dee57610dee612cfc565b60200260200101858481518110610e0757610e07612cfc565b60209081029190910101919091529015159052600101610d60565b50509250929050565b60008054610e3890612d70565b80601f0160208091040260200160405190810160405280929190818152602001828054610e6490612d70565b8015610eb15780601f10610e8657610100808354040283529160200191610eb1565b820191906000526020600020905b815481529060010190602001808311610e9457829003601f168201915b505050505081565b610ec161262d565b6001600160a01b0316846001600160a01b03161480610f8957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d14854610f1386611197565b610f1b61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f899190612cc9565b610fd55760405162461bcd60e51b815260206004820152601d60248201527f53656e6465722063616e6e6f7420626c6f636b207265717565737465720000006044820152606401610608565b826000036110155760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b03821661106b5760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b0384811660008181526003602090815260408083208884528252808320948716808452949091529020805460ff19168415151790557ff31809ebfa88e2c0953544b9b342339317994a5e456412135c34a38f7d82359385846110d261262d565b6040805193845291151560208401526001600160a01b03169082015260600160405180910390a350505050565b600061119161110d83612671565b6040518060400160405280601b81526020017f5769746864726177616c206c6561642074696d652073657474657200000000008152506040516020016111539190612daa565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b92915050565b60006111916111a583612671565b6040518060400160405280601181526020017f52657175657374657220626c6f636b65720000000000000000000000000000008152506040516020016111539190612daa565b6060818067ffffffffffffffff81111561120757611207612ce6565b60405190808252806020026020018201604052801561123a57816020015b60608152602001906001900390816112255790505b50915060005b818110156113645760003086868481811061125d5761125d612cfc565b905060200281019061126f9190612d12565b60405161127d929190612d60565b600060405180830381855af49150503d80600081146112b8576040519150601f19603f3d011682016040523d82523d6000602084013e6112bd565b606091505b508584815181106112d0576112d0612cfc565b602090810291909101015290508061135b5760008483815181106112f6576112f6612cfc565b602002602001015190506000815111156113135780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610608565b50600101611240565b505092915050565b826000036113ac5760405162461bcd60e51b815260206004820152600d60248201526c436861696e204944207a65726f60981b6044820152606401610608565b6001600160a01b0382166114025760405162461bcd60e51b815260206004820152601660248201527f5265717565737465722061646472657373207a65726f000000000000000000006044820152606401610608565b82851480156114225750816001600160a01b0316846001600160a01b0316145b1561146f5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f742075706461746520726571756573746572000000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832089845282528083209388168352929052205460ff16156114ed5760405162461bcd60e51b815260206004820152601a60248201527f50726576696f75732072657175657374657220626c6f636b65640000000000006044820152606401610608565b6001600160a01b03808716600090815260036020908152604080832087845282528083209386168352929052205460ff161561156b5760405162461bcd60e51b815260206004820152601660248201527f4e6578742072657175657374657220626c6f636b6564000000000000000000006044820152606401610608565b6001600160a01b03861660009081526004602052604081209061158c61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156115e95760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b0380871660009081526001602081815260408084208a855282528084208986168552825280842094861684529390529181209182018161162e61262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff16600281111561166a5761166a612b66565b1461171c5760006001820154600160401b900460ff16600281111561169157611691612b66565b036116d45760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601460248201527f5769746864726177616c20696e697469617465640000000000000000000000006044820152606401610608565b6001600160a01b0388811660009081526001602081815260408084208a855282528084208986168552825280842094881684529390529181209182018161176161262d565b6001600160a01b03168152602081019190915260400160002060010154600160401b900460ff16600281111561179957611799612b66565b146117e65760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206465706f73697465640000000000000000006044820152606401610608565b600081600001600081546117f990612ddc565b918290555080835584549091506000908590829061181690612df5565b918290555080865584546040805160808101825282815260018089015463ffffffff166020830152600092820183905260608201819052939450919286019061185d61262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b8360028111156118de576118de612b66565b021790555050604080516080810182526000808252602082018190529181018290529150606082015260018701600061191561262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561199657611996612b66565b02179055509050506119a661262d565b604080518b81526001600160a01b038a8116602083015291810184905260608101869052918116918a8216918f16907f054e367880d46b4892f07cbf12971cc3eaf25aa0e135deb8aa39b1b1b464a10f9060800160405180910390a4611a0a61262d565b604080518d81526001600160a01b038a8116602083015291810184905260608101859052918116918c8216918f16907f1bfc51ce5c8716823ac909ee739d0faff222a753c0d6684ffe76b59383c6cf989060800160405180910390a4505050505050505050505050565b6000611191611a8283612671565b6040518060400160405280601181526020017f4465706f7369746f7220667265657a65720000000000000000000000000000008152506040516020016111539190612daa565b6001600160a01b03808616600090815260036020908152604080832088845282528083209387168352929052205460ff16611b455760405162461bcd60e51b815260206004820152601f60248201527f4169726e6f646520646964206e6f7420626c6f636b20726571756573746572006044820152606401610608565b6001600160a01b03808616600090815260016020818152604080842089855282528084208886168552825280842087861685528252808420948616845291840190528120906001820154600160401b900460ff166002811115611baa57611baa612b66565b03611bed5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff166002811115611c1057611c10612b66565b03611c245750815460001901808355611c28565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001600160a01b038616600090815260018087016020908152604092839020845181559084015191810180549385015163ffffffff9081166401000000000267ffffffffffffffff19909516931692909217929092178082556060840151919068ff00000000000000001916600160401b836002811115611ccf57611ccf612b66565b021790555050604080518a81526001600160a01b038981166020830152918101849052606081018590528188169250898216918c16907f346d2ebe813e4f3cb5eca2d4ff82fdf6cb82ebbcd12a9c313616e526917c56ac9060800160405180910390a46040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038a81166024830152604482018390528716906342842e0e90606401600060405180830381600087803b158015611d9b57600080fd5b505af1158015611daf573d6000803e3d6000fd5b50505050505050505050505050565b6001600160a01b038085166000908152600160208181526040808420888552825280842087861685528252808420948616845293905291812090918290820181611e0661262d565b6001600160a01b0316815260208101919091526040016000209050600180820154600160401b900460ff166002811115611e4257611e42612b66565b14611ef45760006001820154600160401b900460ff166002811115611e6957611e69612b66565b03611eac5760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b60405162461bcd60e51b815260206004820152601c60248201527f5769746864726177616c20616c726561647920696e69746961746564000000006044820152606401610608565b8154600019018083556001820154611f1b90611f169063ffffffff1642612e0c565b612704565b6001830180546802000000000000000068ffffffffff000000001990911668ff00000000000000001964010000000063ffffffff86160216171790559350611f6161262d565b8254604080518a81526001600160a01b0389811660208301529181019290925263ffffffff87166060830152608082018490529182169188811691908b16907f31db03120c5cd862f4acfba61b4c177545e3a506c5110f50cc6ece21586f57539060a00160405180910390a4505050949350505050565b611fe061262d565b6001600160a01b0316836001600160a01b031614806120a857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391d1485461203285611a74565b61203a61262d565b6040516001600160e01b031960e085901b16815260048101929092526001600160a01b03166024820152604401602060405180830381865afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a89190612cc9565b6120f45760405162461bcd60e51b815260206004820152601e60248201527f53656e6465722063616e6e6f7420667265657a65206465706f7369746f7200006044820152606401610608565b6001600160a01b03821661214a5760405162461bcd60e51b815260206004820152601660248201527f4465706f7369746f722061646472657373207a65726f000000000000000000006044820152606401610608565b6001600160a01b038381166000818152600460209081526040808320948716808452949091529020805460ff19168415151790557f9eb8827fae67b31c98956fd47f8403bf132d72d483649ae3ad4f18477087e650836121a861262d565b6040805192151583526001600160a01b0390911660208301520160405180910390a3505050565b6001600160a01b03808516600090815260036020908152604080832087845282528083209386168352929052205460ff161561224d5760405162461bcd60e51b815260206004820152601160248201527f52657175657374657220626c6f636b65640000000000000000000000000000006044820152606401610608565b6001600160a01b03841660009081526004602052604081209061226e61262d565b6001600160a01b0316815260208101919091526040016000205460ff16156122cb5760405162461bcd60e51b815260206004820152601060248201526f2232b837b9b4ba37b910333937bd32b760811b6044820152606401610608565b6001600160a01b03808516600090815260016020818152604080842088855282528084208786168552825280842094861684529390529181209182018161231061262d565b6001600160a01b031681526020810191909152604001600090812091506001820154600160401b900460ff16600281111561234d5761234d612b66565b036123905760405162461bcd60e51b8152602060048201526013602482015272151bdad95b881b9bdd0819195c1bdcda5d1959606a1b6044820152606401610608565b6000600180830154600160401b900460ff1660028111156123b3576123b3612b66565b0361241f57600182015463ffffffff16156124105760405162461bcd60e51b815260206004820152601860248201527f5769746864726177616c206e6f7420696e6974696174656400000000000000006044820152606401610608565b50815460001901808355612485565b6001820154640100000000900463ffffffff164210156124815760405162461bcd60e51b815260206004820152601360248201527f43616e6e6f7420776974686472617720796574000000000000000000000000006044820152606401610608565b5081545b8154604080516080810182526000808252602082018190529181018290529060608201526001850160006124b761262d565b6001600160a01b03168152602080820192909252604090810160002083518155918301516001830180549285015163ffffffff9081166401000000000267ffffffffffffffff19909416921691909117919091178082556060840151919068ff00000000000000001916600160401b83600281111561253857612538612b66565b021790555090505061254861262d565b604080518981526001600160a01b0388811660208301529181018490526060810185905291811691888216918b16907f4777af5e3e1be8181a4183502633c34680db9491e0a972afeeb45414935944fb9060800160405180910390a4846001600160a01b03166342842e0e306125bc61262d565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361266c575060131936013560601c90565b503390565b60006111916126b9836040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b604080516020808201939093527f0000000000000000000000000000000000000000000000000000000000000000818301528151808203830181526060909101909152805191012090565b600063ffffffff8211156127805760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610608565b5090565b6001600160a01b038116811461279957600080fd5b50565b6000602082840312156127ae57600080fd5b81356127b981612784565b9392505050565b6000806000806000608086880312156127d857600080fd5b85356127e381612784565b945060208601356127f381612784565b935060408601359250606086013567ffffffffffffffff8082111561281757600080fd5b818801915088601f83011261282b57600080fd5b81358181111561283a57600080fd5b89602082850101111561284c57600080fd5b9699959850939650602001949392505050565b6000806040838503121561287257600080fd5b823561287d81612784565b9150602083013563ffffffff8116811461289657600080fd5b809150509250929050565b600080600080608085870312156128b757600080fd5b84356128c281612784565b93506020850135925060408501356128d981612784565b915060608501356128e981612784565b939692955090935050565b6000806020838503121561290757600080fd5b823567ffffffffffffffff8082111561291f57600080fd5b818501915085601f83011261293357600080fd5b81358181111561294257600080fd5b8660208260051b850101111561295757600080fd5b60209290920196919550909350505050565b60005b8381101561298457818101518382015260200161296c565b50506000910152565b600081518084526129a5816020860160208601612969565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612a015782840389526129ef84835161298d565b988501989350908401906001016129d7565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612a49578151151584529284019290840190600101612a2b565b50505083810382850152612a5d81866129b9565b9695505050505050565b6020815260006127b9602083018461298d565b801515811461279957600080fd5b60008060008060808587031215612a9e57600080fd5b8435612aa981612784565b9350602085013592506040850135612ac081612784565b915060608501356128e981612a7a565b60008060408385031215612ae357600080fd5b8235612aee81612784565b9150602083013561289681612784565b600080600080600060a08688031215612b1657600080fd5b8535612b2181612784565b9450602086013593506040860135612b3881612784565b92506060860135612b4881612784565b91506080860135612b5881612784565b809150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b84815263ffffffff8481166020830152831660408201526080810160038310612bb557634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b600080600060608486031215612bd957600080fd5b8335612be481612784565b9250602084013591506040840135612bfb81612784565b809150509250925092565b6020815260006127b960208301846129b9565b60008060008060008060c08789031215612c3257600080fd5b8635612c3d81612784565b9550602087013594506040870135612c5481612784565b9350606087013592506080870135612c6b81612784565b915060a0870135612c7b81612784565b809150509295509295509295565b600080600060608486031215612c9e57600080fd5b8335612ca981612784565b92506020840135612cb981612784565b91506040840135612bfb81612a7a565b600060208284031215612cdb57600080fd5b81516127b981612a7a565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612d2957600080fd5b83018035915067ffffffffffffffff821115612d4457600080fd5b602001915036819003821315612d5957600080fd5b9250929050565b8183823760009101908152919050565b600181811c90821680612d8457607f821691505b602082108103612da457634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612dbc818460208701612969565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201612dee57612dee612dc6565b5060010190565b600081612e0457612e04612dc6565b506000190190565b8082018082111561119157611191612dc656fea2646970667358221220f03ccc95b90b36774e156213a313db7129e0a152e0fdeffe877114b75d48363464736f6c63430008110033", - "devdoc": { - "details": "Airnode operators are strongly recommended to only use a single instance of this contract as an authorizer. If multiple instances are used, the state between the instances should be kept consistent. For example, if a requester on a chain is to be blocked, all instances of this contract that are used as authorizers for the chain should be updated. Otherwise, the requester to be blocked can still be authorized via the instances that have not been updated.", - "kind": "dev", - "methods": { - "airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "depositor": "Depositor address", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "earliestWithdrawalTime": "Earliest withdrawal time", - "tokenId": "Token ID", - "withdrawalLeadTime": "Withdrawal lead time captured at deposit-time" - } - }, - "constructor": { - "params": { - "_accessControlRegistry": "AccessControlRegistry contract address", - "_adminRoleDescription": "Admin role description" - } - }, - "deriveDepositorFreezerRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "depositorFreezerRole": "Depositor freezer role" - } - }, - "deriveRequesterBlockerRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "requesterBlockerRole": "Requester blocker role" - } - }, - "deriveWithdrawalLeadTimeSetterRole(address)": { - "params": { - "airnode": "Airnode address" - }, - "returns": { - "withdrawalLeadTimeSetterRole": "Withdrawal lead time setter role" - } - }, - "initiateTokenWithdrawal(address,uint256,address,address)": { - "details": "The depositor is allowed to initiate a withdrawal even if the respective requester is blocked. However, the withdrawal will not be executable as long as the requester is blocked. Token withdrawals can be initiated even if withdrawal lead time is zero.", - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "earliestWithdrawalTime": "Earliest withdrawal time" - } - }, - "isAuthorized(address,uint256,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - }, - "returns": { - "_0": "Authorization status" - } - }, - "multicall(bytes[])": { - "params": { - "data": "Array of calldata of batched calls" - }, - "returns": { - "returndata": "Array of returndata of batched calls" - } - }, - "onERC721Received(address,address,uint256,bytes)": { - "details": "The first argument is the operator, which we do not need", - "params": { - "_data": "Airnode address, chain ID and requester address in ABI-encoded form", - "_from": "Account from which the token is transferred", - "_tokenId": "Token ID" - }, - "returns": { - "_0": "`onERC721Received()` function selector" - } - }, - "revokeToken(address,uint256,address,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "depositor": "Depositor address", - "requester": "Requester address", - "token": "Token address" - } - }, - "setDepositorFreezeStatus(address,address,bool)": { - "params": { - "airnode": "Airnode address", - "depositor": "Depositor address", - "status": "Freeze status" - } - }, - "setRequesterBlockStatus(address,uint256,address,bool)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "status": "Block status" - } - }, - "setWithdrawalLeadTime(address,uint32)": { - "params": { - "airnode": "Airnode address", - "withdrawalLeadTime": "Withdrawal lead time" - } - }, - "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" - } - }, - "updateDepositRequester(address,uint256,address,uint256,address,address)": { - "details": "This is especially useful for not having to wait when the Airnode has set a non-zero withdrawal lead time", - "params": { - "airnode": "Airnode address", - "chainIdNext": "Next chain ID", - "chainIdPrevious": "Previous chain ID", - "requesterNext": "Next requester address", - "requesterPrevious": "Previous requester address", - "token": "Token address" - } - }, - "withdrawToken(address,uint256,address,address)": { - "params": { - "airnode": "Airnode address", - "chainId": "Chain ID", - "requester": "Requester address", - "token": "Token address" - } - } - }, - "title": "Authorizer contract that users can deposit the ERC721 tokens recognized by the Airnode to receive authorization for the requester contract on the chain", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "DEPOSITOR_FREEZER_ROLE_DESCRIPTION()": { - "notice": "Depositor freezer role description" - }, - "REQUESTER_BLOCKER_ROLE_DESCRIPTION()": { - "notice": "Requester blocker role description" - }, - "WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()": { - "notice": "Withdrawal lead time setter role description" - }, - "accessControlRegistry()": { - "notice": "AccessControlRegistry contract address" - }, - "adminRoleDescription()": { - "notice": "Admin role description" - }, - "airnodeToChainIdToRequesterToBlockStatus(address,uint256,address)": { - "notice": "If the Airnode has blocked the requester on the chain. In the context of the respective Airnode, no one can deposit for a blocked requester, make deposit updates that relate to a blocked requester, or withdraw a token deposited for a blocked requester. Anyone can revoke tokens that are already deposited for a blocked requester. Existing deposits for a blocked requester do not provide authorization." - }, - "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(address,uint256,address,address)": { - "notice": "Deposits of the token with the address made for the Airnode to authorize the requester address on the chain" - }, - "airnodeToChainIdToRequesterToTokenToDepositorToDeposit(address,uint256,address,address,address)": { - "notice": "Returns the deposit of the token with the address made by the depositor for the Airnode to authorize the requester address on the chain" - }, - "airnodeToDepositorToFreezeStatus(address,address)": { - "notice": "If the Airnode has frozen the depositor. In the context of the respective Airnode, a frozen depositor cannot deposit, make deposit updates or withdraw." - }, - "airnodeToWithdrawalLeadTime(address)": { - "notice": "Withdrawal lead time of the Airnode. This creates the window of opportunity during which a requester can be blocked for breaking T&C and the respective token can be revoked. The withdrawal lead time at deposit-time will apply to a specific deposit." - }, - "deriveDepositorFreezerRole(address)": { - "notice": "Derives the depositor freezer role for the Airnode" - }, - "deriveRequesterBlockerRole(address)": { - "notice": "Derives the requester blocker role for the Airnode" - }, - "deriveWithdrawalLeadTimeSetterRole(address)": { - "notice": "Derives the withdrawal lead time setter role for the Airnode" - }, - "initiateTokenWithdrawal(address,uint256,address,address)": { - "notice": "Called by a token depositor to initiate withdrawal" - }, - "isAuthorized(address,uint256,address,address)": { - "notice": "Returns if the requester on the chain is authorized for the Airnode due to a token with the address being deposited" - }, - "multicall(bytes[])": { - "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" - }, - "onERC721Received(address,address,uint256,bytes)": { - "notice": "Called by the ERC721 contract upon `safeTransferFrom()` to this contract to deposit a token to authorize the requester" - }, - "revokeToken(address,uint256,address,address,address)": { - "notice": "Called to revoke the token deposited to authorize a requester that is blocked now" - }, - "setDepositorFreezeStatus(address,address,bool)": { - "notice": "Called by the Airnode or its depositor freezers to set the freeze status of the depositor" - }, - "setRequesterBlockStatus(address,uint256,address,bool)": { - "notice": "Called by the Airnode or its requester blockers to set the block status of the requester" - }, - "setWithdrawalLeadTime(address,uint32)": { - "notice": "Called by the Airnode or its withdrawal lead time setters to set withdrawal lead time" - }, - "tryMulticall(bytes[])": { - "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" - }, - "updateDepositRequester(address,uint256,address,uint256,address,address)": { - "notice": "Called by a token depositor to update the requester for which they have deposited the token for" - }, - "withdrawToken(address,uint256,address,address)": { - "notice": "Called by a token depositor to withdraw" - } - }, - "notice": "For an Airnode to treat an ERC721 token deposit as a valid reason for the respective requester contract to be authorized, it needs to be configured at deploy-time to (1) use this contract as an authorizer, (2) recognize the respectice ERC721 token contract. It can be expected for Airnodes to be configured to only recognize the respective NFT keys that their operators have issued, but this is not necessarily true, i.e., an Airnode can be configured to recognize an arbitrary ERC721 token. This contract allows Airnodes to block specific requester contracts. It can be expected for Airnodes to only do this when the requester is breaking T&C. The tokens that have been deposited to authorize requesters that have been blocked can be revoked, which transfers them to the Airnode account. This can be seen as a staking/slashing mechanism. Accordingly, users should not deposit ERC721 tokens to receive authorization from Airnodes that they suspect may abuse this mechanic.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6427, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 13104, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToChainIdToRequesterToTokenAddressToTokenDeposits", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))" - }, - { - "astId": 13110, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToWithdrawalLeadTime", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint32)" - }, - { - "astId": 13120, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToChainIdToRequesterToBlockStatus", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))" - }, - { - "astId": 13128, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "airnodeToDepositorToFreezeStatus", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_enum(DepositState)14691": { - "encoding": "inplace", - "label": "enum IRequesterAuthorizerWithErc721.DepositState", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_bool)))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => mapping(address => bool)))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_mapping(t_address,t_bool))" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits))))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))" - }, - "t_mapping(t_address,t_struct(Deposit)13052_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct RequesterAuthorizerWithErc721.Deposit)", - "numberOfBytes": "32", - "value": "t_struct(Deposit)13052_storage" - }, - "t_mapping(t_address,t_struct(TokenDeposits)13042_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)", - "numberOfBytes": "32", - "value": "t_struct(TokenDeposits)13042_storage" - }, - "t_mapping(t_address,t_uint32)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage)))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => mapping(address => struct RequesterAuthorizerWithErc721.TokenDeposits)))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_mapping(t_address,t_struct(TokenDeposits)13042_storage))" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Deposit)13052_storage": { - "encoding": "inplace", - "label": "struct RequesterAuthorizerWithErc721.Deposit", - "members": [ - { - "astId": 13044, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "tokenId", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 13046, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "withdrawalLeadTime", - "offset": 0, - "slot": "1", - "type": "t_uint32" - }, - { - "astId": 13048, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "earliestWithdrawalTime", - "offset": 4, - "slot": "1", - "type": "t_uint32" - }, - { - "astId": 13051, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "state", - "offset": 8, - "slot": "1", - "type": "t_enum(DepositState)14691" - } - ], - "numberOfBytes": "64" - }, - "t_struct(TokenDeposits)13042_storage": { - "encoding": "inplace", - "label": "struct RequesterAuthorizerWithErc721.TokenDeposits", - "members": [ - { - "astId": 13036, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "count", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 13041, - "contract": "contracts/authorizers/RequesterAuthorizerWithErc721.sol:RequesterAuthorizerWithErc721", - "label": "depositorToDeposit", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_struct(Deposit)13052_storage)" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} diff --git a/deployments/ethereum/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/ethereum/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/ethereum/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/fantom-testnet/AccessControlRegistry.json b/deployments/fantom-testnet/AccessControlRegistry.json index 6bc3b4bf..97851743 100644 --- a/deployments/fantom-testnet/AccessControlRegistry.json +++ b/deployments/fantom-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x3dfd749252f547a44733bfaa0ada607ff696135f98aeaca94b31a3a66f282c1b", + "transactionHash": "0xf35351b77e1796cb6a70f04867e5a88f395968a7fad72787e910ee2e7ccaaca4", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": { "type": "BigNumber", "hex": "0x1a4b8c" }, + "gasUsed": "1063199", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000047ce0000009bfb707f941f2203fbee6e896aa78482499c51a9eeacc99600", - "transactionHash": "0x3dfd749252f547a44733bfaa0ada607ff696135f98aeaca94b31a3a66f282c1b", + "blockHash": "0x00005b5e000002d98f21b43b9bbfe649d63de48753a685d7a30b0dac56916519", + "transactionHash": "0xf35351b77e1796cb6a70f04867e5a88f395968a7fad72787e910ee2e7ccaaca4", "logs": [], - "blockNumber": 14501361, - "confirmations": 169169, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1a4b8c" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x3d1a74c0" }, + "blockNumber": 22948049, + "cumulativeGasUsed": "1063199", "status": 1, - "type": 0, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/fantom-testnet/Api3ServerV1.json b/deployments/fantom-testnet/Api3ServerV1.json index ba800096..2e86bea7 100644 --- a/deployments/fantom-testnet/Api3ServerV1.json +++ b/deployments/fantom-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0xf685ce161c03c7b8a497005ede82649f48edcf766d1dddc760ad54e85c6431b6", + "transactionHash": "0x69df8ada2b02d3abbbb9a39549dfed39d22e369b6339b9bb6ced87946b057532", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2964999", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000047f300000e09ec0efc2cee10e0be88d13b75f64f8aae41b328569f3570f2", - "transactionHash": "0xf685ce161c03c7b8a497005ede82649f48edcf766d1dddc760ad54e85c6431b6", + "blockHash": "0x00005b5e000002e33f03d90ee17c87ebc820433f6c15549d48d2a3220d352819", + "transactionHash": "0x69df8ada2b02d3abbbb9a39549dfed39d22e369b6339b9bb6ced87946b057532", "logs": [], - "blockNumber": 14541214, + "blockNumber": 22948050, "cumulativeGasUsed": "2964999", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/fantom-testnet/ProxyFactory.json b/deployments/fantom-testnet/ProxyFactory.json index 7bd5f3a0..4f09ad24 100644 --- a/deployments/fantom-testnet/ProxyFactory.json +++ b/deployments/fantom-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x4b764f60afde24d047b6d08406e21f9b2cf402801afea13abaac69656db927b0", + "transactionHash": "0x7b7ab41d42d22065bfc70ac9d17c9f235955374a052f19d0a825dda1819c39a6", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1474829", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000047f300000e1e0b4556ebb94950fab67cc1836d46f968c27a162533054e4d", - "transactionHash": "0x4b764f60afde24d047b6d08406e21f9b2cf402801afea13abaac69656db927b0", + "blockHash": "0x00005b5e000002f64292f26c20d5bca8bd7c7b5d722b550dec0361f09567d460", + "transactionHash": "0x7b7ab41d42d22065bfc70ac9d17c9f235955374a052f19d0a825dda1819c39a6", "logs": [], - "blockNumber": 14541216, + "blockNumber": 22948052, "cumulativeGasUsed": "1474829", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/fantom-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/fantom-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/fantom-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/fantom/AccessControlRegistry.json b/deployments/fantom/AccessControlRegistry.json index a529c2fe..2364dbfa 100644 --- a/deployments/fantom/AccessControlRegistry.json +++ b/deployments/fantom/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xf014ba21e039e9c90f57a6a9593bf737c878110e5b13bc181ef5e1a46ef9c954", + "transactionHash": "0xb6fec5741900dde2ce808ea2f642fc3d6c4ec576b1404e8d78797bac076a6863", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1723276", + "transactionIndex": 0, + "gasUsed": "1063199", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000303c40000054ede4c230b6dceb4720ab30f93abc6dec5079549ff3db59834", - "transactionHash": "0xf014ba21e039e9c90f57a6a9593bf737c878110e5b13bc181ef5e1a46ef9c954", + "blockHash": "0x0003d9570000085c2a761c7acc37bb6cb712f29616d91c994b4d9d32acc218c2", + "transactionHash": "0xb6fec5741900dde2ce808ea2f642fc3d6c4ec576b1404e8d78797bac076a6863", "logs": [], - "blockNumber": 57720789, - "cumulativeGasUsed": "2513556", + "blockNumber": 72156335, + "cumulativeGasUsed": "1063199", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/fantom/Api3ServerV1.json b/deployments/fantom/Api3ServerV1.json index ec737067..adec09d7 100644 --- a/deployments/fantom/Api3ServerV1.json +++ b/deployments/fantom/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xdded2677c9df67bf0604f48021fa6c63daec358512e627a460181a0281d4be47", + "transactionHash": "0x1cf6b4ac1e7468b36c981083e24a68257688f3fb9ab9385cf8a57d251648079c", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, + "transactionIndex": 9, "gasUsed": "2964999", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000303c40000063e9cb6d2950be04e65f63d22d88e4dc0ea259d9e2205b572e2", - "transactionHash": "0xdded2677c9df67bf0604f48021fa6c63daec358512e627a460181a0281d4be47", + "blockHash": "0x0003d957000008c6bcec0a061ddb80a524857666ce857d94a2f48665bd5a5bd9", + "transactionHash": "0x1cf6b4ac1e7468b36c981083e24a68257688f3fb9ab9385cf8a57d251648079c", "logs": [], - "blockNumber": 57720802, - "cumulativeGasUsed": "3090794", + "blockNumber": 72156341, + "cumulativeGasUsed": "4209154", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/fantom/OrderPayable.json b/deployments/fantom/OrderPayable.json index 35de1b1e..4dbf3387 100644 --- a/deployments/fantom/OrderPayable.json +++ b/deployments/fantom/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0xae170e07c6db1bf4b6ac26029e2c7298577179820c08aa2855e960c199a72cbf", + "transactionHash": "0xd53c7dae950b2b2e1e63f1625132ac4cce4d44fce87cbe6956b50b160b28e3c8", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 6, + "transactionIndex": 8, "gasUsed": "1236691", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x00033ed80000026cf4e0816ecaf621e2e17bcbf8f5d437de8abf38c239f1c9ce", - "transactionHash": "0xae170e07c6db1bf4b6ac26029e2c7298577179820c08aa2855e960c199a72cbf", + "blockHash": "0x0003d96500000f26dbbc4e17f95880d79c7333e445fee9c431351088197ef82c", + "transactionHash": "0xd53c7dae950b2b2e1e63f1625132ac4cce4d44fce87cbe6956b50b160b28e3c8", "logs": [], - "blockNumber": 63041207, - "cumulativeGasUsed": "2731005", + "blockNumber": 72165955, + "cumulativeGasUsed": "3853381", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/fantom/ProxyFactory.json b/deployments/fantom/ProxyFactory.json index a19fa38a..1e776662 100644 --- a/deployments/fantom/ProxyFactory.json +++ b/deployments/fantom/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xea453927eec1aff7e520f4bf831640ec2a53abcffb20fa31b4d20765498e4712", + "transactionHash": "0x11132d2debcd837d238720f0c1821bd790a66ca5e1b130997e455fc2c9286415", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, + "transactionIndex": 1, "gasUsed": "1474829", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x000303c4000006a184220a3fbb29c89f41b5ea9558e5714fe837c023279ed27d", - "transactionHash": "0xea453927eec1aff7e520f4bf831640ec2a53abcffb20fa31b4d20765498e4712", + "blockHash": "0x0003d957000009211fbf8499a1cae679c0c589665ac17fd5bbba9296c3ada79a", + "transactionHash": "0x11132d2debcd837d238720f0c1821bd790a66ca5e1b130997e455fc2c9286415", "logs": [], - "blockNumber": 57720808, - "cumulativeGasUsed": "2497001", + "blockNumber": 72156345, + "cumulativeGasUsed": "1611491", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/fantom/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/fantom/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/fantom/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/gnosis-testnet/AccessControlRegistry.json b/deployments/gnosis-testnet/AccessControlRegistry.json index 7cf6e78e..3c62f0fc 100644 --- a/deployments/gnosis-testnet/AccessControlRegistry.json +++ b/deployments/gnosis-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x1b3b85c5ac82432dae585049f31489601c223be6de9c30213d464e617d5b8dcc", + "transactionHash": "0xe850f1c2930a9a1ceb7139129b2dd6d1ccad23a875858b6d38d3f05f2a233b1f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x57a39bb6fe1a923362c413c38bbd117fe5bd0451677222e8e4f59bf951532942", - "transactionHash": "0x1b3b85c5ac82432dae585049f31489601c223be6de9c30213d464e617d5b8dcc", + "blockHash": "0x1328d08946d5e424440e39c4b5915b8d5678fe2b2f1f474c86b7aee8bd8d7e00", + "transactionHash": "0xe850f1c2930a9a1ceb7139129b2dd6d1ccad23a875858b6d38d3f05f2a233b1f", "logs": [], - "blockNumber": 2918656, - "confirmations": 229115, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x3b9aca00" }, + "blockNumber": 7268394, + "cumulativeGasUsed": "1062014", "status": 1, - "type": 0, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/gnosis-testnet/Api3ServerV1.json b/deployments/gnosis-testnet/Api3ServerV1.json index 8ea8917f..d690f479 100644 --- a/deployments/gnosis-testnet/Api3ServerV1.json +++ b/deployments/gnosis-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xf367252cda10cff07a04abefc478bfddb07dbb3feff960c24c1d7881d900ce63", + "transactionHash": "0x5dbab823960ef8f5c778729789a87c5770c87fac7fbc25298d97c5218124358b", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "2960756", + "transactionIndex": 0, + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x597c5ca202fc19ad617499fea2fbfb27078e1f83d0bf31d07119b278ecabd05f", - "transactionHash": "0xf367252cda10cff07a04abefc478bfddb07dbb3feff960c24c1d7881d900ce63", + "blockHash": "0x84c8aa1f689dd52b3ac0166de36154b170e423798df2d81ef88dc7b8005b8e06", + "transactionHash": "0x5dbab823960ef8f5c778729789a87c5770c87fac7fbc25298d97c5218124358b", "logs": [], - "blockNumber": 2959487, - "cumulativeGasUsed": "3004507", + "blockNumber": 7268975, + "cumulativeGasUsed": "2961690", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/gnosis-testnet/ProxyFactory.json b/deployments/gnosis-testnet/ProxyFactory.json index 052819d6..1c4ec01c 100644 --- a/deployments/gnosis-testnet/ProxyFactory.json +++ b/deployments/gnosis-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xdce6eda5799d8cf46c908a98eceba2c14a9573624eabdb9f1132444ac0ac64f1", + "transactionHash": "0x29615592c21df5551d7a88c53956a919435ad37fe0694139de2539b40db0e6a5", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1472737", + "transactionIndex": 1, + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf41162b2fc178e47b01d0e3ebfd7c6b530ddca33018e03b4f494300f054feafb", - "transactionHash": "0xdce6eda5799d8cf46c908a98eceba2c14a9573624eabdb9f1132444ac0ac64f1", + "blockHash": "0x00eb55abe9251fd550d251c15a4a403c4bc836846619125a40956076fd7943f6", + "transactionHash": "0x29615592c21df5551d7a88c53956a919435ad37fe0694139de2539b40db0e6a5", "logs": [], - "blockNumber": 2959489, - "cumulativeGasUsed": "1472737", + "blockNumber": 7268976, + "cumulativeGasUsed": "1804975", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/gnosis-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/gnosis-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/gnosis-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/gnosis/AccessControlRegistry.json b/deployments/gnosis/AccessControlRegistry.json index 334f02a3..b0f73773 100644 --- a/deployments/gnosis/AccessControlRegistry.json +++ b/deployments/gnosis/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x307ed72206f28fb9a0cb7b7c6701331bb43b724846f5ab6eb3f2911595e92bba", + "transactionHash": "0xcc586c4383a39f39d55a2286c727a2fea77c09e7847ab4e3a3cff539aef1e990", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1720828", + "transactionIndex": 7, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa69cf24d9d9e8bf055fd40b33f90be92883cd92906435f91c69cc8fe6fe5c54a", - "transactionHash": "0x307ed72206f28fb9a0cb7b7c6701331bb43b724846f5ab6eb3f2911595e92bba", + "blockHash": "0xd00487df63933a637406ce180f07c6ae4cd71e2124548904f243bb203e2ec03b", + "transactionHash": "0xcc586c4383a39f39d55a2286c727a2fea77c09e7847ab4e3a3cff539aef1e990", "logs": [], - "blockNumber": 26975348, - "cumulativeGasUsed": "1720828", + "blockNumber": 31307049, + "cumulativeGasUsed": "3335729", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/gnosis/Api3ServerV1.json b/deployments/gnosis/Api3ServerV1.json index 6e91e96c..1956a789 100644 --- a/deployments/gnosis/Api3ServerV1.json +++ b/deployments/gnosis/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x4d06c159918a13073bde28d7562acb5fb7e0d8e59690068edc554661fb89d68d", + "transactionHash": "0xcbe6f26ed83686205033bdc8c1c247a2304e86e93efe839feab2dd9ffafa346c", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "2960756", + "transactionIndex": 16, + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2de57831ff388768d446e90a551f47bb3ad37f0cfc1db9c01be1acf989e905b0", - "transactionHash": "0x4d06c159918a13073bde28d7562acb5fb7e0d8e59690068edc554661fb89d68d", + "blockHash": "0x6ad91325e3bf45250d1ccb8b2d6617bbf8b747e7b247d042334a089edf6883c4", + "transactionHash": "0xcbe6f26ed83686205033bdc8c1c247a2304e86e93efe839feab2dd9ffafa346c", "logs": [], - "blockNumber": 26975353, - "cumulativeGasUsed": "2960756", + "blockNumber": 31307055, + "cumulativeGasUsed": "5320484", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/gnosis/OrderPayable.json b/deployments/gnosis/OrderPayable.json index f454f97d..592634e6 100644 --- a/deployments/gnosis/OrderPayable.json +++ b/deployments/gnosis/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0xb9b55ca91ca01c4a801e4a5805bc0025606d307cf61c6b54ab04195753714827", + "transactionHash": "0xde2cf5e29693e343fb777774ba7cb24b5b9269c9d9867bc1760e3f9d77e20de7", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1234983", + "transactionIndex": 8, + "gasUsed": "1235415", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb432905a80152fef39e145b57f292693f2bf90a2c8f3ac4803391a45c93d1a9b", - "transactionHash": "0xb9b55ca91ca01c4a801e4a5805bc0025606d307cf61c6b54ab04195753714827", + "blockHash": "0xc3d3d07711b66aadcc07498d29fb99bb7b4f6219ddba67152d2ab519b057a984", + "transactionHash": "0xde2cf5e29693e343fb777774ba7cb24b5b9269c9d9867bc1760e3f9d77e20de7", "logs": [], - "blockNumber": 28119552, - "cumulativeGasUsed": "1447619", + "blockNumber": 31323833, + "cumulativeGasUsed": "16948839", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/gnosis/ProxyFactory.json b/deployments/gnosis/ProxyFactory.json index 047d4410..8ad76562 100644 --- a/deployments/gnosis/ProxyFactory.json +++ b/deployments/gnosis/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x17fcf0e12bbae43a5b32bc1f8e01a3337149b5576c669cde84518a5bec520023", + "transactionHash": "0x4d70fa694c3485b1885aa750977dcb43ebbcb2197b4dc74c6e7db18cfde0af85", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "1472737", + "transactionIndex": 4, + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x3d21fb4f9b1e9cd3a6c27dbb7d83a89e1940c6e193e70a39f932e120b96c58c5", - "transactionHash": "0x17fcf0e12bbae43a5b32bc1f8e01a3337149b5576c669cde84518a5bec520023", + "blockHash": "0x0b88d3ef95554f2eedc60ace8004658797fe06fe458bfcfcfa9c2d8422fa221f", + "transactionHash": "0x4d70fa694c3485b1885aa750977dcb43ebbcb2197b4dc74c6e7db18cfde0af85", "logs": [], - "blockNumber": 26975354, - "cumulativeGasUsed": "2103768", + "blockNumber": 31307058, + "cumulativeGasUsed": "4483992", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/gnosis/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/gnosis/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/gnosis/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/kava-testnet/AccessControlRegistry.json b/deployments/kava-testnet/AccessControlRegistry.json index a7c41da9..6aaebccd 100644 --- a/deployments/kava-testnet/AccessControlRegistry.json +++ b/deployments/kava-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x26e2edade8d49659be774c38caf0201919c9cc11e2747d34e55c894a11b67792", + "transactionHash": "0x1298ec90f0f5f014dcbea1b376ad5501b355fc9043cacadbf02f8b4c13bb6eb3", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1720828", + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x69bc250bcea662b3b976fa37b3701c6a48b4fab30210d337422575b866ff3c70", - "transactionHash": "0x26e2edade8d49659be774c38caf0201919c9cc11e2747d34e55c894a11b67792", + "blockHash": "0x05d916303094e4ac96259ed4e0aedc05faac7818f9bf3b2c787fda5d6d99783c", + "transactionHash": "0x1298ec90f0f5f014dcbea1b376ad5501b355fc9043cacadbf02f8b4c13bb6eb3", "logs": [], - "blockNumber": 6232734, - "cumulativeGasUsed": "1720828", + "blockNumber": 8690193, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/kava-testnet/Api3ServerV1.json b/deployments/kava-testnet/Api3ServerV1.json index e9827210..006fcdfb 100644 --- a/deployments/kava-testnet/Api3ServerV1.json +++ b/deployments/kava-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0x2069f1f455bc8ea496890317638bd5abadaaec2698a904b3c318a90da168b2bc", + "transactionHash": "0xc7065658024fd19d53438dbb8ff901e19d60e7affe832bbfa486908a0a9b3307", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x821f4a378d8f9c034d8e6c7c585a7d419835e6a2873bd516570818320c3f5d71", - "transactionHash": "0x2069f1f455bc8ea496890317638bd5abadaaec2698a904b3c318a90da168b2bc", + "blockHash": "0x712db87b6279b30b5d7a9ab02b977d5bcce2d931225213271638ad824715d3ad", + "transactionHash": "0xc7065658024fd19d53438dbb8ff901e19d60e7affe832bbfa486908a0a9b3307", "logs": [], - "blockNumber": 6232739, + "blockNumber": 8690194, "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/kava-testnet/ProxyFactory.json b/deployments/kava-testnet/ProxyFactory.json index b5872fdb..d5df26da 100644 --- a/deployments/kava-testnet/ProxyFactory.json +++ b/deployments/kava-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x2461df5003adbd6e58c50065dd04a6098bb71c0dc074aef5a9d82227f5e8169b", + "transactionHash": "0x0bf2522379ea51f4be090f5e668162175d859a6e8c2207acf1d74f7c8af0103f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 1, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb46be8dc1c9fc8101e55451948bd9b85fa3484ff617945c6c271f015ba886a41", - "transactionHash": "0x2461df5003adbd6e58c50065dd04a6098bb71c0dc074aef5a9d82227f5e8169b", + "blockHash": "0x93f429a68987b7a39c63beaa1d5667d081bcdb812364311e24b3133e3e04d30b", + "transactionHash": "0x0bf2522379ea51f4be090f5e668162175d859a6e8c2207acf1d74f7c8af0103f", "logs": [], - "blockNumber": 6232741, - "cumulativeGasUsed": "1472737", + "blockNumber": 8690196, + "cumulativeGasUsed": "1972737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/kava-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/kava-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/kava-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/kava/AccessControlRegistry.json b/deployments/kava/AccessControlRegistry.json index b6589785..2474ed68 100644 --- a/deployments/kava/AccessControlRegistry.json +++ b/deployments/kava/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x7e247a69699c1f58dc5910252f8ce08bebec24a2c8434434912ba7ec7624f34e", + "transactionHash": "0xd8f2b36105b5a23feb6a8c4c8168f7f025cd8646c4b41b9d8c23f52c2aed9bc4", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1720828", + "transactionIndex": 0, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8f1813efa68e93a737e403442d159bb9430588972339e9be0b6ef8de8143f76d", - "transactionHash": "0x7e247a69699c1f58dc5910252f8ce08bebec24a2c8434434912ba7ec7624f34e", + "blockHash": "0xbfcba0e24d2a1d9e846d5be81481dd3e12d2427bbab1c8ba4d710643d389a579", + "transactionHash": "0xd8f2b36105b5a23feb6a8c4c8168f7f025cd8646c4b41b9d8c23f52c2aed9bc4", "logs": [], - "blockNumber": 6465624, - "cumulativeGasUsed": "2156794", + "blockNumber": 7622817, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/kava/Api3ServerV1.json b/deployments/kava/Api3ServerV1.json index d3981b16..085ee6f9 100644 --- a/deployments/kava/Api3ServerV1.json +++ b/deployments/kava/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xab1157ac3ab78345e0efbd6d9a246ed991e53ada8dea81e9bd362f2be9661e69", + "transactionHash": "0xe036dbd77d533050abc1af1ec7404c75bfdc7e9f6600f3a5bb2dc3d9e48916d8", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 5, + "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xeab0f26653828bb1021fbde6a4490f5e18de6c5c3d4542135756d3ab8198bbba", - "transactionHash": "0xab1157ac3ab78345e0efbd6d9a246ed991e53ada8dea81e9bd362f2be9661e69", + "blockHash": "0x9970ccd7fcc4289d7bda646436252f341d3a82000f34dd78b4e7b6158625e215", + "transactionHash": "0xe036dbd77d533050abc1af1ec7404c75bfdc7e9f6600f3a5bb2dc3d9e48916d8", "logs": [], - "blockNumber": 6465657, - "cumulativeGasUsed": "3926271", + "blockNumber": 7622819, + "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/kava/OrderPayable.json b/deployments/kava/OrderPayable.json index c54d2833..f1910fdd 100644 --- a/deployments/kava/OrderPayable.json +++ b/deployments/kava/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x26de476e716c3f62d3984d877b1151aa2dd315f00e1b9179c7c4fb11861550df", + "transactionHash": "0xfc08b24736edf5424134efa616911969dc3261365fc924e6601df74cf6d505ec", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 10, + "transactionIndex": 0, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5e04473b2852ccf7ec6dc4e9e14c9e62e1249e718f6efa60614d00063cfee322", - "transactionHash": "0x26de476e716c3f62d3984d877b1151aa2dd315f00e1b9179c7c4fb11861550df", + "blockHash": "0x7613d67775dfb869cd753169b34bebf8a3bdcccd19176c7c2be74e4e5e016f3f", + "transactionHash": "0xfc08b24736edf5424134efa616911969dc3261365fc924e6601df74cf6d505ec", "logs": [], - "blockNumber": 6465680, - "cumulativeGasUsed": "3584172", + "blockNumber": 7636630, + "cumulativeGasUsed": "1234983", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17535, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/kava/ProxyFactory.json b/deployments/kava/ProxyFactory.json index 55ad8bd9..79edc622 100644 --- a/deployments/kava/ProxyFactory.json +++ b/deployments/kava/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x9404a15dc118a9ba4fa4c7347da7767569ff9839431d13f8eea9a98d44c11ff3", + "transactionHash": "0xdfdfb04ec10f4a5e4ce1dab15fcb69b16274f68ae9f4d8a44cfd38bd48c962f6", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 4, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x736c0d720b52fec3f503a2d05164655e7d56259eb5ebffb25fd4be568386f8fc", - "transactionHash": "0x9404a15dc118a9ba4fa4c7347da7767569ff9839431d13f8eea9a98d44c11ff3", + "blockHash": "0x9d4731ca22169f07859d4cbf5adf3b0d9ce34d4e7f0c1388d7622a012c6b5965", + "transactionHash": "0xdfdfb04ec10f4a5e4ce1dab15fcb69b16274f68ae9f4d8a44cfd38bd48c962f6", "logs": [], - "blockNumber": 6465659, - "cumulativeGasUsed": "2331471", + "blockNumber": 7622822, + "cumulativeGasUsed": "3304600", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/kava/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/kava/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/kava/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/linea-goerli-testnet/AccessControlRegistry.json b/deployments/linea-goerli-testnet/AccessControlRegistry.json index 33979cdb..be9bb3bb 100644 --- a/deployments/linea-goerli-testnet/AccessControlRegistry.json +++ b/deployments/linea-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,19 @@ "type": "function" } ], - "transactionHash": "0xe1d01870fd3148b12b6e3d61d4d75c8b4e7400b4814ca193c5906711943c2c5f", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 11, - "gasUsed": "1720828", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd71d30ae738c07266fa1705c7b139c0a476ceffd0b47be1849a10dc32a3607d9", - "transactionHash": "0xe1d01870fd3148b12b6e3d61d4d75c8b4e7400b4814ca193c5906711943c2c5f", - "logs": [], - "blockNumber": 1121436, - "cumulativeGasUsed": "3136457", - "status": 1, - "byzantium": true + "blockNumber": 2504514 }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +417,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +445,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +470,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/linea-goerli-testnet/Api3ServerV1.json b/deployments/linea-goerli-testnet/Api3ServerV1.json index 860e2af6..bf95b7c3 100644 --- a/deployments/linea-goerli-testnet/Api3ServerV1.json +++ b/deployments/linea-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,19 @@ "type": "function" } ], - "transactionHash": "0x447428f901eace8546a940ac380bdadf9a8a3630c2793e2d8420602afc9b9709", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 12, - "gasUsed": "2960756", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5f205efc11fba5748d088c4b0300ebad9ad09c0abe228ca8d3d392c3974343ee", - "transactionHash": "0x447428f901eace8546a940ac380bdadf9a8a3630c2793e2d8420602afc9b9709", - "logs": [], - "blockNumber": 1121439, - "cumulativeGasUsed": "3212756", - "status": 1, - "byzantium": true + "blockNumber": 2504859 }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +997,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1005,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1029,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1053,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1074,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1099,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/linea-goerli-testnet/ProxyFactory.json b/deployments/linea-goerli-testnet/ProxyFactory.json index ab955f11..f816ea87 100644 --- a/deployments/linea-goerli-testnet/ProxyFactory.json +++ b/deployments/linea-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,12 @@ "type": "function" } ], - "transactionHash": "0x073357532e9cdf5beb1f1f5f66e8c981e78899472ef697258c030fd9f0d42cc7", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1472737", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x3de39b3e147671f31f51274dcbc4c0de8ec37a5ffa168b2483ae62a73281d3a0", - "transactionHash": "0x073357532e9cdf5beb1f1f5f66e8c981e78899472ef697258c030fd9f0d42cc7", - "logs": [], - "blockNumber": 1121440, - "cumulativeGasUsed": "1514737", - "status": 1, - "byzantium": true + "blockNumber": 2505015 }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/linea-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/linea-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/linea-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/linea/AccessControlRegistry.json b/deployments/linea/AccessControlRegistry.json index 57a63151..14fa730c 100644 --- a/deployments/linea/AccessControlRegistry.json +++ b/deployments/linea/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xc06b0aaba48840c03d78bf6ef90a66d4986e3eaacf9f41bb73a20a4118eb7e6c", + "transactionHash": "0x31d91b7deb674cf50793bbc2673ba61d44f2d695c3a731f299c31259a55e0b68", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "1720828", + "transactionIndex": 4, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9e7f4d4bbbeffda254646319e9773d7214761445eee66a0bb4a7d46340b1ba9d", - "transactionHash": "0xc06b0aaba48840c03d78bf6ef90a66d4986e3eaacf9f41bb73a20a4118eb7e6c", + "blockHash": "0x8c2ea1647145d9de5316dc421de0082757a0facbb3f03f60d9fb66442b360150", + "transactionHash": "0x31d91b7deb674cf50793bbc2673ba61d44f2d695c3a731f299c31259a55e0b68", "logs": [], - "blockNumber": 412566, - "cumulativeGasUsed": "2186408", + "blockNumber": 1094473, + "cumulativeGasUsed": "1155134", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/linea/Api3ServerV1.json b/deployments/linea/Api3ServerV1.json index dbc7b347..3492f760 100644 --- a/deployments/linea/Api3ServerV1.json +++ b/deployments/linea/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x73a2b9681d7cb3bfb08eba3a9970528fb788e03856c34d560161735f78134c77", + "transactionHash": "0x3e21d68863d41c670701e341b175f1a824cb474dba0f4459d24b9ad714a772ae", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 5, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x3be4d960fceff22c941233a024031f945ff11c7767476626aba750c199c5e32a", - "transactionHash": "0x73a2b9681d7cb3bfb08eba3a9970528fb788e03856c34d560161735f78134c77", + "blockHash": "0xc31a3f5854b5098ac9a31bb3a5a9a67241d464f87f3d05c581dade1127b0108c", + "transactionHash": "0x3e21d68863d41c670701e341b175f1a824cb474dba0f4459d24b9ad714a772ae", "logs": [], - "blockNumber": 412580, - "cumulativeGasUsed": "2960756", + "blockNumber": 1094475, + "cumulativeGasUsed": "3231674", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/linea/OrderPayable.json b/deployments/linea/OrderPayable.json index 5b8a5782..24ab1912 100644 --- a/deployments/linea/OrderPayable.json +++ b/deployments/linea/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x195f48b31d7799a713200afec62415b51c3c0c880d1cfaef4152bddcaac7cb46", + "transactionHash": "0xfc4923fb5dd65f7afba8c1d64a4e6fcfa01a5e9101b3bf0632ddd83b99f350ca", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, + "transactionIndex": 4, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x57277446f68706cdbe484be6888c12da2ed29bab913df05a7683b408498509a8", - "transactionHash": "0x195f48b31d7799a713200afec62415b51c3c0c880d1cfaef4152bddcaac7cb46", + "blockHash": "0xe22aada6955ad75c3cbae9ea6a2a9a0c6a934528fd7c3207e6149a89be7ae03c", + "transactionHash": "0xfc4923fb5dd65f7afba8c1d64a4e6fcfa01a5e9101b3bf0632ddd83b99f350ca", "logs": [], - "blockNumber": 412590, - "cumulativeGasUsed": "1466176", + "blockNumber": 1109154, + "cumulativeGasUsed": "1842960", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17535, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/linea/ProxyFactory.json b/deployments/linea/ProxyFactory.json index 6e324141..35a96cfe 100644 --- a/deployments/linea/ProxyFactory.json +++ b/deployments/linea/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0xdadfd1637d5d42efb2694c3494f49e8f01f3274e36534bab7771caf1ff7b6ac0", + "transactionHash": "0x9e8379d1ddcb36f92d333c395064ba8e3db4f89c14757313eac1ece13c59ad41", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 3, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa9cc82b865bcd2f326874293280d1f38b3adc8bcea47b8b334ba7073f5ad325e", - "transactionHash": "0xdadfd1637d5d42efb2694c3494f49e8f01f3274e36534bab7771caf1ff7b6ac0", + "blockHash": "0xa98627c8a70b169f591f815b685882fcc7642003d852ddc8c24e2151c7dc33c8", + "transactionHash": "0x9e8379d1ddcb36f92d333c395064ba8e3db4f89c14757313eac1ece13c59ad41", "logs": [], - "blockNumber": 412581, - "cumulativeGasUsed": "1639732", + "blockNumber": 1094477, + "cumulativeGasUsed": "1590791", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/linea/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/linea/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/linea/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/mantle-goerli-testnet/AccessControlRegistry.json b/deployments/mantle-goerli-testnet/AccessControlRegistry.json index b8ab4715..b7e6f80e 100644 --- a/deployments/mantle-goerli-testnet/AccessControlRegistry.json +++ b/deployments/mantle-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x06286e0e4afd58c6d82ecaf97eec2e5f029e2b25edf5d3437482a147655ed43b", + "transactionHash": "0xd6667391ba82c40409463c782b0527dabd33b51f6c25775dcfae246ec8bcec26", "receipt": { - "to": null, + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1717458", + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x86b536b2f6ccaeef89ee6a034a9119f9d6831de254e88ef5e8a33c8135084f7a", - "transactionHash": "0x06286e0e4afd58c6d82ecaf97eec2e5f029e2b25edf5d3437482a147655ed43b", + "blockHash": "0x9230cc503da44f5a9c41702d694d5123d7666abc9079e6e533688b1cc85cb108", + "transactionHash": "0xd6667391ba82c40409463c782b0527dabd33b51f6c25775dcfae246ec8bcec26", "logs": [], - "blockNumber": 15355467, - "cumulativeGasUsed": "1717458", + "blockNumber": 26958881, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/mantle-goerli-testnet/Api3ServerV1.json b/deployments/mantle-goerli-testnet/Api3ServerV1.json index a90ef24a..25bd7b0a 100644 --- a/deployments/mantle-goerli-testnet/Api3ServerV1.json +++ b/deployments/mantle-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xf736ec9227422d718e6fbed6dc6e9a187cce2dc5a265f0ff3fff8267c9b783fd", + "transactionHash": "0x13e30ff042d46f86475021df8d681eabec90d409af035577904ee8de112583f1", "receipt": { - "to": null, + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "2954518", + "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe37e79fc65ed8f91309b6426698d0b02e576349a6d031e201371d2338289091c", - "transactionHash": "0xf736ec9227422d718e6fbed6dc6e9a187cce2dc5a265f0ff3fff8267c9b783fd", + "blockHash": "0xc6aa1b8b6d76516b3de72f5ef3b15d79e24d83707c60c023fae9645729a98ac9", + "transactionHash": "0x13e30ff042d46f86475021df8d681eabec90d409af035577904ee8de112583f1", "logs": [], - "blockNumber": 15355491, - "cumulativeGasUsed": "2954518", + "blockNumber": 26958896, + "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", - "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE" + "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/mantle-goerli-testnet/OwnableCallForwarder.json b/deployments/mantle-goerli-testnet/OwnableCallForwarder.json index 9454b71a..d1b6e445 100644 --- a/deployments/mantle-goerli-testnet/OwnableCallForwarder.json +++ b/deployments/mantle-goerli-testnet/OwnableCallForwarder.json @@ -1,5 +1,5 @@ { - "address": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "abi": [ { "inputs": [ @@ -89,54 +89,54 @@ "type": "function" } ], - "transactionHash": "0x93baf31323f37e01e64bed2b1a932a5f960872172769d46683faa7157c53c8a7", + "transactionHash": "0x8333adcb046738a2f0af6f7c209ec163f2fa668a48481d4448f3c147e729bc82", "receipt": { - "to": null, + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "409746", - "logsBloom": "0x00000080000000000000000000000000000000000000000000800000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000040000000000000000000000000", - "blockHash": "0xaf47aeea46c666a3fbd8b8d13251f008e8dfc7a6ae35ccbcfeeecca97a5e4864", - "transactionHash": "0x93baf31323f37e01e64bed2b1a932a5f960872172769d46683faa7157c53c8a7", + "gasUsed": "410706", + "logsBloom": "0x00000080000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000040000000000020000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000020000000000000000000010000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000000000000000000000000000000", + "blockHash": "0x887678c81d3f791b54d23670900968d940a9d7da08d0bca489c0afc48b63ca51", + "transactionHash": "0x8333adcb046738a2f0af6f7c209ec163f2fa668a48481d4448f3c147e729bc82", "logs": [ { "transactionIndex": 0, - "blockNumber": 15355484, - "transactionHash": "0x93baf31323f37e01e64bed2b1a932a5f960872172769d46683faa7157c53c8a7", - "address": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", + "blockNumber": 26958886, + "transactionHash": "0x8333adcb046738a2f0af6f7c209ec163f2fa668a48481d4448f3c147e729bc82", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" ], "data": "0x", "logIndex": 0, - "blockHash": "0xaf47aeea46c666a3fbd8b8d13251f008e8dfc7a6ae35ccbcfeeecca97a5e4864" + "blockHash": "0x887678c81d3f791b54d23670900968d940a9d7da08d0bca489c0afc48b63ca51" }, { "transactionIndex": 0, - "blockNumber": 15355484, - "transactionHash": "0x93baf31323f37e01e64bed2b1a932a5f960872172769d46683faa7157c53c8a7", - "address": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", + "blockNumber": 26958886, + "transactionHash": "0x8333adcb046738a2f0af6f7c209ec163f2fa668a48481d4448f3c147e729bc82", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" ], "data": "0x", "logIndex": 1, - "blockHash": "0xaf47aeea46c666a3fbd8b8d13251f008e8dfc7a6ae35ccbcfeeecca97a5e4864" + "blockHash": "0x887678c81d3f791b54d23670900968d940a9d7da08d0bca489c0afc48b63ca51" } ], - "blockNumber": 15355484, - "cumulativeGasUsed": "409746", + "blockNumber": 26958886, + "cumulativeGasUsed": "410706", "status": 1, "byzantium": true }, "args": ["0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1"], - "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "numDeployments": 2, + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/mantle-goerli-testnet/ProxyFactory.json b/deployments/mantle-goerli-testnet/ProxyFactory.json index d2c27fed..4570bdda 100644 --- a/deployments/mantle-goerli-testnet/ProxyFactory.json +++ b/deployments/mantle-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x3570acfbe5fe8eab94d8ed0cf94cf6322cd9eafb23c6e585f39c70a5bbe7ce9c", + "transactionHash": "0x3c262fd20e468a9d5bfccfcc1da97dd5ec2ed6ba60b4e83be0f75014c7bfcf03", "receipt": { - "to": null, + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1469833", + "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd21486b3e75ef6416c2aa7a8f99c4c8909e0ac8934aff6dcb39966818d418070", - "transactionHash": "0x3570acfbe5fe8eab94d8ed0cf94cf6322cd9eafb23c6e585f39c70a5bbe7ce9c", + "blockHash": "0xf7614ce840cbf3350fcbc39d2647f5436239e922ef393dbcaaaecc3167438159", + "transactionHash": "0x3c262fd20e468a9d5bfccfcc1da97dd5ec2ed6ba60b4e83be0f75014c7bfcf03", "logs": [], - "blockNumber": 15355507, - "cumulativeGasUsed": "1469833", + "blockNumber": 26958899, + "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/mantle-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/mantle-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/mantle-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/mantle/AccessControlRegistry.json b/deployments/mantle/AccessControlRegistry.json index 9df0099c..e98ba9c1 100644 --- a/deployments/mantle/AccessControlRegistry.json +++ b/deployments/mantle/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x27725491bfad35b8d7486468b11566c899c011166c68295bbdb3226c88f28eb1", + "transactionHash": "0xf14f1685c03a6dda1ba79a9ee5719825d8afa3a8e80433b5c9d3e210fade75f9", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1720828", + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xda91e7261b7c1f987d3dd8e863ab6db76f4886604c631e96e7db6319172288f6", - "transactionHash": "0x27725491bfad35b8d7486468b11566c899c011166c68295bbdb3226c88f28eb1", + "blockHash": "0xbdba4c43a8bb6f0ef61b5f67632a4b996140b7e4d855c6cce962a757b433c04b", + "transactionHash": "0xf14f1685c03a6dda1ba79a9ee5719825d8afa3a8e80433b5c9d3e210fade75f9", "logs": [], - "blockNumber": 4272645, - "cumulativeGasUsed": "1720828", + "blockNumber": 25122378, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/mantle/Api3ServerV1.json b/deployments/mantle/Api3ServerV1.json index 2e8be197..d3b4cafd 100644 --- a/deployments/mantle/Api3ServerV1.json +++ b/deployments/mantle/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0xb008f05f498dd87e7f3fe1af15cadd6c9795578b0327cba9d82e0698a36f3374", + "transactionHash": "0x6d80d90ae06c74e023d73c41420717302081f3aa2b4d641cd0a49ab09c38a236", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe2ef8dc047f3a1fac0a233e379798b4a4d16e4259b0a95284b60873d16e93a92", - "transactionHash": "0xb008f05f498dd87e7f3fe1af15cadd6c9795578b0327cba9d82e0698a36f3374", + "blockHash": "0xe363566a38d8f17768ded77793ef58a9466d418dd1eaa6d2aaea9b7748c3fec2", + "transactionHash": "0x6d80d90ae06c74e023d73c41420717302081f3aa2b4d641cd0a49ab09c38a236", "logs": [], - "blockNumber": 4272670, + "blockNumber": 25122385, "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/mantle/OrderPayable.json b/deployments/mantle/OrderPayable.json index ecee4929..11c5f38d 100644 --- a/deployments/mantle/OrderPayable.json +++ b/deployments/mantle/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,7 +277,7 @@ "type": "function" } ], - "transactionHash": "0x5d2ed8ef396db2cf524522841e3232a190882f8416f0c528d913ee6fca462b6a", + "transactionHash": "0x1ffffcf2aa43578d2bad85065e7af8c1ce41b7bbc5a616817705efce9c720f5c", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -285,24 +285,24 @@ "transactionIndex": 0, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7e993a8806f5d96cf7594e495c996a94c7a5ad12e72790ece8b29b937e1d4e56", - "transactionHash": "0x5d2ed8ef396db2cf524522841e3232a190882f8416f0c528d913ee6fca462b6a", + "blockHash": "0x1bf04a821be48517c34992f4204ad08fdc1bd1835a4930d8c7e193492455b6db", + "transactionHash": "0x1ffffcf2aa43578d2bad85065e7af8c1ce41b7bbc5a616817705efce9c720f5c", "logs": [], - "blockNumber": 4272681, + "blockNumber": 25400815, "cumulativeGasUsed": "1234983", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17535, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/mantle/ProxyFactory.json b/deployments/mantle/ProxyFactory.json index b14d0642..d297f2c8 100644 --- a/deployments/mantle/ProxyFactory.json +++ b/deployments/mantle/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x56a4293821ffc8e1bedae05228017e0e0d7284334d4fb11e730d8263a4971fbb", + "transactionHash": "0x57b0c12620b93cdb4879d85c2d896d00fb675511922cbb2a4abb1e6c6c6e2507", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfb8e0a02a2ca5818bf4962a243274dbf5c9ba21bfa390150d93cc9c39a8dd3e9", - "transactionHash": "0x56a4293821ffc8e1bedae05228017e0e0d7284334d4fb11e730d8263a4971fbb", + "blockHash": "0x2308aa81e024d072fbeef9650b84b8468a1b7ebf19f811162a2fb33ddb915cd1", + "transactionHash": "0x57b0c12620b93cdb4879d85c2d896d00fb675511922cbb2a4abb1e6c6c6e2507", "logs": [], - "blockNumber": 4272677, + "blockNumber": 25122393, "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/mantle/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/mantle/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/mantle/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/metis-goerli-testnet/AccessControlRegistry.json b/deployments/metis-goerli-testnet/AccessControlRegistry.json deleted file mode 100644 index 4fd83e2b..00000000 --- a/deployments/metis-goerli-testnet/AccessControlRegistry.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "address": "0x8262a9DAB3f8a0b1E6317551E214CeA89Bc3f56d", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0xdd8de6d5e12b834ab315f4bb045accf40310b0e8b59c1ba75ad060717647c987", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x8262a9DAB3f8a0b1E6317551E214CeA89Bc3f56d", - "transactionIndex": 0, - "gasUsed": "1717458", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7e0642e92b44ab1f4e8cd70a5aea0992a88d8f8aea6e40cbdf9bba517968e7aa", - "transactionHash": "0xdd8de6d5e12b834ab315f4bb045accf40310b0e8b59c1ba75ad060717647c987", - "logs": [], - "blockNumber": 719583, - "cumulativeGasUsed": "1717458", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, - "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": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, - "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" - }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, - "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)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => 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/metis-goerli-testnet/Api3ServerV1.json b/deployments/metis-goerli-testnet/Api3ServerV1.json deleted file mode 100644 index 4054d2a0..00000000 --- a/deployments/metis-goerli-testnet/Api3ServerV1.json +++ /dev/null @@ -1,1137 +0,0 @@ -{ - "address": "0xDDe9CE3736939d59A70c446c8A4AB6714CB4a41a", - "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": "0xebffbec1647627fef01a766599a722a030144759c0328feb9e646b5e1d24ddb0", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xDDe9CE3736939d59A70c446c8A4AB6714CB4a41a", - "transactionIndex": 0, - "gasUsed": "2954518", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb82ef37571d7fb143504fb56ae9126da77353c7c0576ba3c622f93f26e7422b5", - "transactionHash": "0xebffbec1647627fef01a766599a722a030144759c0328feb9e646b5e1d24ddb0", - "logs": [], - "blockNumber": 719588, - "cumulativeGasUsed": "2954518", - "status": 1, - "byzantium": true - }, - "args": [ - "0x8262a9DAB3f8a0b1E6317551E214CeA89Bc3f56d", - "Api3ServerV1 admin", - "0xC02Ea0f403d5f3D45a4F1d0d817e7A2601346c9E" - ], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "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": 2826, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4153, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "_dataFeeds", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" - }, - { - "astId": 4642, - "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)4147_storage))" - }, - { - "astId": 4648, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "oevProxyToBalance", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 3975, - "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)4147_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", - "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_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)4147_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", - "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(DataFeed)4147_storage": { - "encoding": "inplace", - "label": "struct DataFeedServer.DataFeed", - "members": [ - { - "astId": 4144, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "value", - "offset": 0, - "slot": "0", - "type": "t_int224" - }, - { - "astId": 4146, - "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/metis-goerli-testnet/ProxyFactory.json b/deployments/metis-goerli-testnet/ProxyFactory.json deleted file mode 100644 index d101f143..00000000 --- a/deployments/metis-goerli-testnet/ProxyFactory.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "address": "0x3d0Ca9e5490E36627beA9a8cb3cefa12D7cDc0af", - "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": "0x1235f5830c1887ea24bdd90c72722ca1876cf2dcacff069714386066830efd10", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x3d0Ca9e5490E36627beA9a8cb3cefa12D7cDc0af", - "transactionIndex": 0, - "gasUsed": "1469833", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x547a68118d496cd0922c8ab86f26fefd5a205667b478e6058e5ead0865669325", - "transactionHash": "0x1235f5830c1887ea24bdd90c72722ca1876cf2dcacff069714386066830efd10", - "logs": [], - "blockNumber": 719590, - "cumulativeGasUsed": "1469833", - "status": 1, - "byzantium": true - }, - "args": ["0xDDe9CE3736939d59A70c446c8A4AB6714CB4a41a"], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/metis/AccessControlRegistry.json b/deployments/metis/AccessControlRegistry.json deleted file mode 100644 index 7f6ded4f..00000000 --- a/deployments/metis/AccessControlRegistry.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "address": "0x824cb5cE2894cBA4eDdd005c5029eD17F5FEcf99", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0xe9737755c0b7c60691517f19e778b751195936153dbc9d8618ca41a9f5c35983", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x824cb5cE2894cBA4eDdd005c5029eD17F5FEcf99", - "transactionIndex": 0, - "gasUsed": "1717458", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf55708121b0f808940f6f60f911264af82129205924c1d73bf8f39df126d1f07", - "transactionHash": "0xe9737755c0b7c60691517f19e778b751195936153dbc9d8618ca41a9f5c35983", - "logs": [], - "blockNumber": 5092413, - "cumulativeGasUsed": "1717458", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, - "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": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, - "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" - }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, - "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)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => 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/metis/Api3ServerV1.json b/deployments/metis/Api3ServerV1.json deleted file mode 100644 index 3783c5c3..00000000 --- a/deployments/metis/Api3ServerV1.json +++ /dev/null @@ -1,1137 +0,0 @@ -{ - "address": "0x784b1ce3fa1e60Bc1cf924711f0D5AA484C9b37e", - "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": "0xe7f8b8c836ae06aa5eac15fab5a84731aeec9f9de35690f372ebd3efadccd379", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x784b1ce3fa1e60Bc1cf924711f0D5AA484C9b37e", - "transactionIndex": 0, - "gasUsed": "2954506", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8e3d0aefaedeb15a3a9aaf7aff65246ca06c0797b78cdbcb22c60be58e8189d6", - "transactionHash": "0xe7f8b8c836ae06aa5eac15fab5a84731aeec9f9de35690f372ebd3efadccd379", - "logs": [], - "blockNumber": 5092417, - "cumulativeGasUsed": "2954506", - "status": 1, - "byzantium": true - }, - "args": [ - "0x824cb5cE2894cBA4eDdd005c5029eD17F5FEcf99", - "Api3ServerV1 admin", - "0x2D6D050Fc44d4db1c8577f4cF87905811fA126b2" - ], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "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": 2826, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4153, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "_dataFeeds", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" - }, - { - "astId": 4642, - "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)4147_storage))" - }, - { - "astId": 4648, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "oevProxyToBalance", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 3975, - "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)4147_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", - "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_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)4147_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", - "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(DataFeed)4147_storage": { - "encoding": "inplace", - "label": "struct DataFeedServer.DataFeed", - "members": [ - { - "astId": 4144, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "value", - "offset": 0, - "slot": "0", - "type": "t_int224" - }, - { - "astId": 4146, - "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/metis/ProxyFactory.json b/deployments/metis/ProxyFactory.json deleted file mode 100644 index a72e9621..00000000 --- a/deployments/metis/ProxyFactory.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "address": "0xd9b82260eaaa2CDe8150474C94C130ca681bB127", - "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": "0x51fd7a710223a01271a2055165ea7e8cf48cd9b0c7f088aa856fb9eba54cace4", - "receipt": { - "to": null, - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xd9b82260eaaa2CDe8150474C94C130ca681bB127", - "transactionIndex": 0, - "gasUsed": "1469833", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2953da3cc7000db26fcca5cb4fa639e2e7a345602770b90a33fb649af6d1513b", - "transactionHash": "0x51fd7a710223a01271a2055165ea7e8cf48cd9b0c7f088aa856fb9eba54cace4", - "logs": [], - "blockNumber": 5092418, - "cumulativeGasUsed": "1469833", - "status": 1, - "byzantium": true - }, - "args": ["0x784b1ce3fa1e60Bc1cf924711f0D5AA484C9b37e"], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/milkomeda-c1-testnet/AccessControlRegistry.json b/deployments/milkomeda-c1-testnet/AccessControlRegistry.json deleted file mode 100644 index 1047652b..00000000 --- a/deployments/milkomeda-c1-testnet/AccessControlRegistry.json +++ /dev/null @@ -1,713 +0,0 @@ -{ - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0x571e1df5f62a574ddf860925e00cfb97f4a6b2cfd7018e0f69660fc1eb668c1a", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5ee4d937426c314c1af72e0c135184b0767f0955b7b9c6a2b8ed657f5db78abb", - "transactionHash": "0x571e1df5f62a574ddf860925e00cfb97f4a6b2cfd7018e0f69660fc1eb668c1a", - "logs": [], - "blockNumber": 10629063, - "confirmations": 286726, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1ab6b4" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0df8475800" }, - "status": 1, - "type": 0, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, - "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": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, - "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" - }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, - "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)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => 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/milkomeda-c1-testnet/Api3ServerV1.json b/deployments/milkomeda-c1-testnet/Api3ServerV1.json deleted file mode 100644 index f94555e9..00000000 --- a/deployments/milkomeda-c1-testnet/Api3ServerV1.json +++ /dev/null @@ -1,1137 +0,0 @@ -{ - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "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": "0x8c6982bb8ca13d3a8628402b4c180208cc66912f4ebe719ae4aa541926f7ebe0", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "2960756", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x96c009f5d3b08393017d6fccd2d9dc18fa7a3b8335737ce9239a215a59282ae7", - "transactionHash": "0x8c6982bb8ca13d3a8628402b4c180208cc66912f4ebe719ae4aa541926f7ebe0", - "logs": [], - "blockNumber": 10680264, - "cumulativeGasUsed": "2960756", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "Api3ServerV1 admin", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6" - ], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "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": 2826, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4153, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "_dataFeeds", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" - }, - { - "astId": 4642, - "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)4147_storage))" - }, - { - "astId": 4648, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "oevProxyToBalance", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 3975, - "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)4147_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", - "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_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)4147_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", - "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(DataFeed)4147_storage": { - "encoding": "inplace", - "label": "struct DataFeedServer.DataFeed", - "members": [ - { - "astId": 4144, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "value", - "offset": 0, - "slot": "0", - "type": "t_int224" - }, - { - "astId": 4146, - "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/milkomeda-c1-testnet/ProxyFactory.json b/deployments/milkomeda-c1-testnet/ProxyFactory.json deleted file mode 100644 index 59f84d3a..00000000 --- a/deployments/milkomeda-c1-testnet/ProxyFactory.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "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": "0xcddfd4c20d64787d5db42a6fd2c32620b822b72be40c7f80ff828662616980c6", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1472737", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc6382e34c2653f8949b0c19c3e09cc2322cc545bd312eeed9d331fc8ad1f473f", - "transactionHash": "0xcddfd4c20d64787d5db42a6fd2c32620b822b72be40c7f80ff828662616980c6", - "logs": [], - "blockNumber": 10680266, - "cumulativeGasUsed": "1472737", - "status": 1, - "byzantium": true - }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/milkomeda-c1/AccessControlRegistry.json b/deployments/milkomeda-c1/AccessControlRegistry.json deleted file mode 100644 index 1a8b0f3f..00000000 --- a/deployments/milkomeda-c1/AccessControlRegistry.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0x36b854ee463a12ee3320036956bd5ddf2730ef6142b792c4ee336b4116959353", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1720828", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7f14f705ecc45c93219e845e4bf3b56995dec9aa69a1b64b8c786b0f12b35c3d", - "transactionHash": "0x36b854ee463a12ee3320036956bd5ddf2730ef6142b792c4ee336b4116959353", - "logs": [], - "blockNumber": 9654456, - "cumulativeGasUsed": "1720828", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, - "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": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, - "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" - }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, - "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)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => 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/milkomeda-c1/Api3ServerV1.json b/deployments/milkomeda-c1/Api3ServerV1.json deleted file mode 100644 index 33add67a..00000000 --- a/deployments/milkomeda-c1/Api3ServerV1.json +++ /dev/null @@ -1,1137 +0,0 @@ -{ - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "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": "0x902a0ee21393f52106d435b3bd269d18190ac696251a94259ca055e0bf1af5a3", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "2960756", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8bda794e07e70f1df786e21d7ad80adcb7bd98ae7bc0ae8f3f2dd1724e885c6e", - "transactionHash": "0x902a0ee21393f52106d435b3bd269d18190ac696251a94259ca055e0bf1af5a3", - "logs": [], - "blockNumber": 9654464, - "cumulativeGasUsed": "3173858", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "Api3ServerV1 admin", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6" - ], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "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": 2826, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4153, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "_dataFeeds", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" - }, - { - "astId": 4642, - "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)4147_storage))" - }, - { - "astId": 4648, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "oevProxyToBalance", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 3975, - "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)4147_storage))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", - "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_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)4147_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", - "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(DataFeed)4147_storage": { - "encoding": "inplace", - "label": "struct DataFeedServer.DataFeed", - "members": [ - { - "astId": 4144, - "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", - "label": "value", - "offset": 0, - "slot": "0", - "type": "t_int224" - }, - { - "astId": 4146, - "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/milkomeda-c1/ProxyFactory.json b/deployments/milkomeda-c1/ProxyFactory.json deleted file mode 100644 index 6d5b7a2c..00000000 --- a/deployments/milkomeda-c1/ProxyFactory.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "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": "0xdf7951ec77c064c05c1bda51bfb697bac387979562072409876ecffd0a844ee7", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1472737", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe387cccba6d12ca6bf6a0275d5f2c553c6f794197286896b790c5c9699917a69", - "transactionHash": "0xdf7951ec77c064c05c1bda51bfb697bac387979562072409876ecffd0a844ee7", - "logs": [], - "blockNumber": 9654466, - "cumulativeGasUsed": "1472737", - "status": 1, - "byzantium": true - }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], - "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/moonbeam-testnet/AccessControlRegistry.json b/deployments/moonbeam-testnet/AccessControlRegistry.json index 3fd2e812..4e8bd4ca 100644 --- a/deployments/moonbeam-testnet/AccessControlRegistry.json +++ b/deployments/moonbeam-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,19 @@ "type": "function" } ], - "transactionHash": "0x1d36451bd6fef232690144935c610d1a6959eb9d57048d922678f9db211172f3", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x8d0092aea8b18463d9623fd5ca72d8fc1f1fd2287868687b16f6711734cdbcc8", - "transactionHash": "0x1d36451bd6fef232690144935c610d1a6959eb9d57048d922678f9db211172f3", - "logs": [], - "blockNumber": 3936958, - "confirmations": 88254, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x60db8840" }, - "status": 1, - "type": 2, - "byzantium": true + "blockNumber": 5631525 }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +417,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +445,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +470,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/moonbeam-testnet/Api3ServerV1.json b/deployments/moonbeam-testnet/Api3ServerV1.json index e4decacd..d6aa335c 100644 --- a/deployments/moonbeam-testnet/Api3ServerV1.json +++ b/deployments/moonbeam-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x27fad3b358d083037666aa18f9901f6c9ec9dd31dde24ee58bae11778aa41d4b", + "transactionHash": "0x04c2e7fd7058dff852ff3b62a39df94a6d125d594c04fdce09fd70422c46817a", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "2960756", + "gasUsed": "4929288", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe95dd68d8a4152595a5128f26c050adbb2e178b2ea9bae2d994f555af0f7d87e", - "transactionHash": "0x27fad3b358d083037666aa18f9901f6c9ec9dd31dde24ee58bae11778aa41d4b", + "blockHash": "0xa98bc94bf9aab7f0cc8b4e791f4d4f822f94ff23513a472bba7145d49fd457d6", + "transactionHash": "0x04c2e7fd7058dff852ff3b62a39df94a6d125d594c04fdce09fd70422c46817a", "logs": [], - "blockNumber": 3951904, - "cumulativeGasUsed": "2960756", + "blockNumber": 5631550, + "cumulativeGasUsed": "4929288", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/moonbeam-testnet/ProxyFactory.json b/deployments/moonbeam-testnet/ProxyFactory.json index 5ac95f79..c0e8e7de 100644 --- a/deployments/moonbeam-testnet/ProxyFactory.json +++ b/deployments/moonbeam-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x4bdecc9526ef413bc8c9cb85b7ee48952df37d7209b73f233ae053d739c86db5", + "transactionHash": "0xa092043c45be9c920ba35327b1b2506524d1e11dab614950a0cf423faac01fb1", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1472737", + "gasUsed": "2455494", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0f616b941153768675ced2a9d336e98b64e37ac8be3d392d94a9de4f2af0944f", - "transactionHash": "0x4bdecc9526ef413bc8c9cb85b7ee48952df37d7209b73f233ae053d739c86db5", + "blockHash": "0x73f4789f6c954079a731d33f0570144198907d24bb5da27bc81f7085c01fea4c", + "transactionHash": "0xa092043c45be9c920ba35327b1b2506524d1e11dab614950a0cf423faac01fb1", "logs": [], - "blockNumber": 3951906, - "cumulativeGasUsed": "1472737", + "blockNumber": 5631552, + "cumulativeGasUsed": "2455494", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/moonbeam-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/moonbeam-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/moonbeam-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/moonbeam/AccessControlRegistry.json b/deployments/moonbeam/AccessControlRegistry.json index 22b27b45..3b401df4 100644 --- a/deployments/moonbeam/AccessControlRegistry.json +++ b/deployments/moonbeam/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xe139f7ad39b8eeda62aeb95d7a48f6f181d2aa1046bac16be9f7fc4775b06de7", + "transactionHash": "0x50303b71cf59d0dd4792f1885608d50f3634d1146b218bba98c56ae1c57b72f5", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "1720828", + "transactionIndex": 6, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa695beb5e8cccc9e518577efd95ebc21213d8e1945fd53fee335700a876301bb", - "transactionHash": "0xe139f7ad39b8eeda62aeb95d7a48f6f181d2aa1046bac16be9f7fc4775b06de7", + "blockHash": "0xb5f8fa50abad6c424bd6c1f1379ac54422720d14545e1b66546ec64616b8cac1", + "transactionHash": "0x50303b71cf59d0dd4792f1885608d50f3634d1146b218bba98c56ae1c57b72f5", "logs": [], - "blockNumber": 3153181, - "cumulativeGasUsed": "1741828", + "blockNumber": 5023316, + "cumulativeGasUsed": "6772584", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/moonbeam/Api3ServerV1.json b/deployments/moonbeam/Api3ServerV1.json index bcf721ef..6311e3a6 100644 --- a/deployments/moonbeam/Api3ServerV1.json +++ b/deployments/moonbeam/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x62a7e3dd3c5b9da8a37e52d8265bc75dcf336afe9397c2e20da5fd2469cb57c9", + "transactionHash": "0x81ba49f2e72fdf0ef1c688429051e96c942b0f55f2082e0ca46ef0ce5351e198", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "2960756", + "transactionIndex": 10, + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf79514ece45a52445fa275616f070c756e8157ee9e543f51fd3b38449b5f75b7", - "transactionHash": "0x62a7e3dd3c5b9da8a37e52d8265bc75dcf336afe9397c2e20da5fd2469cb57c9", + "blockHash": "0xa730be875bc71f2936537412b7571fcf7e0ce3dabb1068c7f7ef595bee2e9f16", + "transactionHash": "0x81ba49f2e72fdf0ef1c688429051e96c942b0f55f2082e0ca46ef0ce5351e198", "logs": [], - "blockNumber": 3153187, - "cumulativeGasUsed": "3263120", + "blockNumber": 5023318, + "cumulativeGasUsed": "10874273", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/moonbeam/OrderPayable.json b/deployments/moonbeam/OrderPayable.json index 3f1533d9..0401206f 100644 --- a/deployments/moonbeam/OrderPayable.json +++ b/deployments/moonbeam/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x0dad1e5d0d489bc9aea04f71f7468e94f677778cbdbb6ee0e4a8a9c843a2ece7", + "transactionHash": "0x3e47ab7bbbfc4c549c2acdf45ebdaf52f50f18ea87c16b36e4783814ba73513a", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 12, - "gasUsed": "1234983", + "transactionIndex": 1, + "gasUsed": "1235415", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa8fd163d08cb56805c36facc0efaf2279a66af154034e9c4ed89fe172e2ed8ef", - "transactionHash": "0x0dad1e5d0d489bc9aea04f71f7468e94f677778cbdbb6ee0e4a8a9c843a2ece7", + "blockHash": "0x8d5e825340a5d68d26cf5f4e9036a341654f0686680d22fb39d743cca94b5786", + "transactionHash": "0x3e47ab7bbbfc4c549c2acdf45ebdaf52f50f18ea87c16b36e4783814ba73513a", "logs": [], - "blockNumber": 3636977, - "cumulativeGasUsed": "2223338", + "blockNumber": 5030520, + "cumulativeGasUsed": "1568599", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/moonbeam/ProxyFactory.json b/deployments/moonbeam/ProxyFactory.json index 2426e853..f2285321 100644 --- a/deployments/moonbeam/ProxyFactory.json +++ b/deployments/moonbeam/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x9c88b1c407f0c81a90049961f3ceff321d8421e744a3b7d8c8a1dfb5c34f355e", + "transactionHash": "0x36454da289a7795e4d508094e07bf817cb44600fe35822299ecf5c5332e1180a", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "1472737", + "transactionIndex": 9, + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x02c5f1b9222f1152a728be271400a4693020b67b09d9a732c9492a22d742d53d", - "transactionHash": "0x9c88b1c407f0c81a90049961f3ceff321d8421e744a3b7d8c8a1dfb5c34f355e", + "blockHash": "0xda41895ec87cf103366e2300e16882e87627fc0fa2ddc08194779b41fff8dae4", + "transactionHash": "0x36454da289a7795e4d508094e07bf817cb44600fe35822299ecf5c5332e1180a", "logs": [], - "blockNumber": 3153189, - "cumulativeGasUsed": "1768145", + "blockNumber": 5023320, + "cumulativeGasUsed": "5572099", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/moonbeam/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/moonbeam/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/moonbeam/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/moonriver/AccessControlRegistry.json b/deployments/moonriver/AccessControlRegistry.json index 5c9fd67b..3ce6b292 100644 --- a/deployments/moonriver/AccessControlRegistry.json +++ b/deployments/moonriver/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xe1fbd876fa9320dc83e7e506d9f06ddfc62949cdb239f3763e38c60e386f536b", + "transactionHash": "0x23c4ff202f32f6480e84356ae9b0f2487f55f45d831de92484c2620a069af9f1", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1720828", + "gasUsed": "1752408", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x36cfadb51bb8fb9d7a05675fbc296ba2f58e3754bc37d593400c52182237851e", - "transactionHash": "0xe1fbd876fa9320dc83e7e506d9f06ddfc62949cdb239f3763e38c60e386f536b", + "blockHash": "0x818b0212bb47ebcaa657b1b26d1609249bd91c191deaf4f1a7e11033572bd34f", + "transactionHash": "0x23c4ff202f32f6480e84356ae9b0f2487f55f45d831de92484c2620a069af9f1", "logs": [], - "blockNumber": 3832937, - "cumulativeGasUsed": "1720828", + "blockNumber": 5690345, + "cumulativeGasUsed": "1752408", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/moonriver/Api3ServerV1.json b/deployments/moonriver/Api3ServerV1.json index fa0a7da1..d326e44b 100644 --- a/deployments/moonriver/Api3ServerV1.json +++ b/deployments/moonriver/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0xc2872e3406ace5edbdb4ef9f49d5f176ea6be68fd12b1fde60840aa1bdb378b0", + "transactionHash": "0xf2c2c019b87845a2489e8fc8572d664debaec409b96b2894f7519ea185de6e66", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "2960756", + "transactionIndex": 2, + "gasUsed": "4929288", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xa246fd5301af9cf913edbf3a8851186e9e1f21f21030c11373d22b2462136495", - "transactionHash": "0xc2872e3406ace5edbdb4ef9f49d5f176ea6be68fd12b1fde60840aa1bdb378b0", + "blockHash": "0x97960c966591e0ac300381a980926a7d8f2a3aac932359509ceea98ad17e654d", + "transactionHash": "0xf2c2c019b87845a2489e8fc8572d664debaec409b96b2894f7519ea185de6e66", "logs": [], - "blockNumber": 3832943, - "cumulativeGasUsed": "2960756", + "blockNumber": 5690347, + "cumulativeGasUsed": "5021512", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/moonriver/OrderPayable.json b/deployments/moonriver/OrderPayable.json index d6594ea0..99bb081d 100644 --- a/deployments/moonriver/OrderPayable.json +++ b/deployments/moonriver/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0x935d95172b6e1753c48802d38c903e2a951ffb0bd0b94d8d8c26e0fde6bdfd73", + "transactionHash": "0x7bfbc063bd699f8485e0e160777a621401d9995075309bac70e6970027a2fbc3", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1234983", + "transactionIndex": 5, + "gasUsed": "2010072", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x83b037a06e147af07432c04bc2ba34221690ff0b4a5feb841a47e82207326e7e", - "transactionHash": "0x935d95172b6e1753c48802d38c903e2a951ffb0bd0b94d8d8c26e0fde6bdfd73", + "blockHash": "0x9686d1dea226bb1e504f7243522d382005cd179957ac23fe01455c87ef75f689", + "transactionHash": "0x7bfbc063bd699f8485e0e160777a621401d9995075309bac70e6970027a2fbc3", "logs": [], - "blockNumber": 4314286, - "cumulativeGasUsed": "1234983", + "blockNumber": 5690996, + "cumulativeGasUsed": "2733534", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/moonriver/ProxyFactory.json b/deployments/moonriver/ProxyFactory.json index 66656ca2..24400e0d 100644 --- a/deployments/moonriver/ProxyFactory.json +++ b/deployments/moonriver/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x4ffe734181e973b66f3c55dfc4c523f3379f91f8b539f891201798d1492f2402", + "transactionHash": "0x3c97cb80dafbb12a44ddcec43addd6ed2556bfda80984bca9e256982117e6425", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1472737", + "transactionIndex": 2, + "gasUsed": "2455494", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf98ca2fa70401456ab810d93c70d46b4ae705b04ab54f17b9daad20d327731ac", - "transactionHash": "0x4ffe734181e973b66f3c55dfc4c523f3379f91f8b539f891201798d1492f2402", + "blockHash": "0x08a9d0eaa456e5ed0bce74baf05e6f789494a962e9977731c71bd28bbc917d2c", + "transactionHash": "0x3c97cb80dafbb12a44ddcec43addd6ed2556bfda80984bca9e256982117e6425", "logs": [], - "blockNumber": 3832945, - "cumulativeGasUsed": "1472737", + "blockNumber": 5690349, + "cumulativeGasUsed": "2823706", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/moonriver/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/moonriver/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/moonriver/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/optimism-goerli-testnet/AccessControlRegistry.json b/deployments/optimism-goerli-testnet/AccessControlRegistry.json index 750dc9b8..fc955345 100644 --- a/deployments/optimism-goerli-testnet/AccessControlRegistry.json +++ b/deployments/optimism-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0xdfcd99f1b46105de6b6e4da6e497423cca648a3fe2ceeb5bbf41bccb444ff3b9", + "transactionHash": "0x9bc6ec59b6f98fc8d49ae18c52797e3ab5543da54a4205ad9632c874e0c4a472", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 9, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, + "transactionIndex": 1, + "gasUsed": "1062014", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xaf12fa6ce7f9e6e0f0283731f2d0307ac7ced3e6ecad4b1affb0f9daf622dea6", - "transactionHash": "0xdfcd99f1b46105de6b6e4da6e497423cca648a3fe2ceeb5bbf41bccb444ff3b9", + "blockHash": "0x17af1d6db5b3009daf1221df754d8b71dc9fb07b92a16076c1740bff839fd600", + "transactionHash": "0x9bc6ec59b6f98fc8d49ae18c52797e3ab5543da54a4205ad9632c874e0c4a472", "logs": [], - "blockNumber": 6677891, - "confirmations": 572323, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x25eff5" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x31" }, + "blockNumber": 18265214, + "cumulativeGasUsed": "1108915", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/optimism-goerli-testnet/Api3ServerV1.json b/deployments/optimism-goerli-testnet/Api3ServerV1.json index 66bb7652..68f103ca 100644 --- a/deployments/optimism-goerli-testnet/Api3ServerV1.json +++ b/deployments/optimism-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x801dd4f0053c9c5050324aa98da63eb50e9a6e4752fcbd46059a4180553b19f9", + "transactionHash": "0x8df2322b88fd2cb18dc7c0cc24d8367876cdc5f1759c1c8b5852e828e0614ddb", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 1, - "gasUsed": "2960756", + "gasUsed": "2961690", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1770245d60a9e9225681fcc56f9bda7787c728eee638c73d6b51552b404f81f4", - "transactionHash": "0x801dd4f0053c9c5050324aa98da63eb50e9a6e4752fcbd46059a4180553b19f9", + "blockHash": "0xcb51a873a799a3c28997902f9118f3bb5e25d7768e9a669556d2de6cf02e3237", + "transactionHash": "0x8df2322b88fd2cb18dc7c0cc24d8367876cdc5f1759c1c8b5852e828e0614ddb", "logs": [], - "blockNumber": 6779277, - "cumulativeGasUsed": "2960756", + "blockNumber": 18265217, + "cumulativeGasUsed": "3008591", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/optimism-goerli-testnet/ProxyFactory.json b/deployments/optimism-goerli-testnet/ProxyFactory.json index 32b58923..fdb7d92e 100644 --- a/deployments/optimism-goerli-testnet/ProxyFactory.json +++ b/deployments/optimism-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0xc377b760f145d80871321ff91d85a91f83093b262093c6af68156a6e52a10823", + "transactionHash": "0x276c19ee9a46b92796f224aedaa35cdfa62b89b9abcefea4db5dc74f3ef87a41", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 4, - "gasUsed": "1472737", + "gasUsed": "1473171", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xeb8aba94d571b85ae51b9a6c432ccbf19f082f1dd92ffe982f5a62085cd24164", - "transactionHash": "0xc377b760f145d80871321ff91d85a91f83093b262093c6af68156a6e52a10823", + "blockHash": "0xa19ad6b742fb9abab393ae0ad77dbc553b374424f8acecf6a39a5a56a1734415", + "transactionHash": "0x276c19ee9a46b92796f224aedaa35cdfa62b89b9abcefea4db5dc74f3ef87a41", "logs": [], - "blockNumber": 6779283, - "cumulativeGasUsed": "2353294", + "blockNumber": 18265220, + "cumulativeGasUsed": "1634402", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/optimism-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/optimism-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/optimism-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/optimism/AccessControlRegistry.json b/deployments/optimism/AccessControlRegistry.json index e85989d2..b7f8f5d1 100644 --- a/deployments/optimism/AccessControlRegistry.json +++ b/deployments/optimism/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x8e29eb498e903caa397648136bb9ac352bbfe8b39eafb3a21f515adcca81235d", + "transactionHash": "0x27618aeb04ffae56444694170d6bace2a02d4a95a4a8a526673b08362864f6f9", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "1720828", + "transactionIndex": 9, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xaee84396bfaba146a49cd640b76745a0d7f76e6ede10d1abe6fe7baafc51b326", - "transactionHash": "0x8e29eb498e903caa397648136bb9ac352bbfe8b39eafb3a21f515adcca81235d", + "blockHash": "0x9884b16a24e77e9766acb277ccf72a4d70d1233d1bd02bfedb0d4298f480b9fa", + "transactionHash": "0x27618aeb04ffae56444694170d6bace2a02d4a95a4a8a526673b08362864f6f9", "logs": [], - "blockNumber": 81462343, - "cumulativeGasUsed": "1720828", + "blockNumber": 113178117, + "cumulativeGasUsed": "2042434", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/optimism/Api3ServerV1.json b/deployments/optimism/Api3ServerV1.json index 5d8b4b98..46003f90 100644 --- a/deployments/optimism/Api3ServerV1.json +++ b/deployments/optimism/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x93deb901b29dc9eee0040abc4f6955a5b2a49300ec1da8e89945dbb5f40f3bd0", + "transactionHash": "0xa3fbc2378358c832ecbf2c82493cf810eaf89883612d9cf0596ef5db599bfa14", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 6, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb2ade6812686c10ded4932abd028f6f4158a8a6a2d57c2e4a4ff487adc43b42d", - "transactionHash": "0x93deb901b29dc9eee0040abc4f6955a5b2a49300ec1da8e89945dbb5f40f3bd0", + "blockHash": "0x4d5d76897e8c3d94c4bf5429f6fd4b2756635d5539d90afacfd7f0575b59bec1", + "transactionHash": "0xa3fbc2378358c832ecbf2c82493cf810eaf89883612d9cf0596ef5db599bfa14", "logs": [], - "blockNumber": 81462409, - "cumulativeGasUsed": "2960756", + "blockNumber": 113178121, + "cumulativeGasUsed": "3690347", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/optimism/OrderPayable.json b/deployments/optimism/OrderPayable.json index 1ff5bb00..c743d6f1 100644 --- a/deployments/optimism/OrderPayable.json +++ b/deployments/optimism/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,32 +277,32 @@ "type": "function" } ], - "transactionHash": "0xd411b6df63b3d192e1de5e6e076d7aff4e7c5bf01eac8aa107ad691a1360b61e", + "transactionHash": "0x653f1709d4e56fd91fa53273bc9b49839225219c236c23bacda02195e633dc0f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 10, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1bc0482220ec372887ecc4d86f4cc03da758e1104932b5185aaa92bb9fe3fd66", - "transactionHash": "0xd411b6df63b3d192e1de5e6e076d7aff4e7c5bf01eac8aa107ad691a1360b61e", + "blockHash": "0x610c776c507d4a12f6de4ad2cf98fd0613498b6922eea4223145598692c6b43c", + "transactionHash": "0x653f1709d4e56fd91fa53273bc9b49839225219c236c23bacda02195e633dc0f", "logs": [], - "blockNumber": 101351571, - "cumulativeGasUsed": "1234983", + "blockNumber": 113182284, + "cumulativeGasUsed": "8541365", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/optimism/ProxyFactory.json b/deployments/optimism/ProxyFactory.json index 96e8f448..2a9fd05e 100644 --- a/deployments/optimism/ProxyFactory.json +++ b/deployments/optimism/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x0a5111fba2212498980a89bea0417444a333b012bbbb33ba4e77ee5625d18ca4", + "transactionHash": "0xad099fb8e69f1b660e57a121722ae4ce20dbb1fbc830c1378756ceddf4453f86", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 0, + "transactionIndex": 4, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb69a26abff56c6885f94cac00985b91b9fbcece11f6a89e3cfa6d877d97d416d", - "transactionHash": "0x0a5111fba2212498980a89bea0417444a333b012bbbb33ba4e77ee5625d18ca4", + "blockHash": "0x89ba3fbb3e10553c04ed833dc69942b8cd96ce9f4be8f6e2c1d469c7276dfe97", + "transactionHash": "0xad099fb8e69f1b660e57a121722ae4ce20dbb1fbc830c1378756ceddf4453f86", "logs": [], - "blockNumber": 81462433, - "cumulativeGasUsed": "1472737", + "blockNumber": 113178125, + "cumulativeGasUsed": "1582650", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/optimism/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/optimism/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/optimism/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/polygon-testnet/AccessControlRegistry.json b/deployments/polygon-testnet/AccessControlRegistry.json index a147273c..dd56f5dd 100644 --- a/deployments/polygon-testnet/AccessControlRegistry.json +++ b/deployments/polygon-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,69 +342,48 @@ "type": "function" } ], - "transactionHash": "0xe844368b5f9f34d89b8a2423762aef626f4497b925364abdea8866bcbf94e548", + "transactionHash": "0x36ad2add2f65c43afc95a0474b2e9ee32d7c718ffa0833d71824b507b4e4d04d", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "logsBloom": "0x00000080000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000020000000000000020001000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xf48c483b8d7f95a45e2df4bd56d878855ba99cfd6b70b13551913d318b07e59a", - "transactionHash": "0xe844368b5f9f34d89b8a2423762aef626f4497b925364abdea8866bcbf94e548", + "transactionIndex": 5, + "gasUsed": "1062014", + "logsBloom": "0x00000080000000000000000000000000000000000000000000000000020000000000000002000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000100000", + "blockHash": "0x19a9c0d499616b972cde19fd5bd238fb8f9fc2d8a16d813bb76e68c02894702d", + "transactionHash": "0x36ad2add2f65c43afc95a0474b2e9ee32d7c718ffa0833d71824b507b4e4d04d", "logs": [ { - "transactionIndex": 2, - "blockNumber": 33096183, - "transactionHash": "0xe844368b5f9f34d89b8a2423762aef626f4497b925364abdea8866bcbf94e548", + "transactionIndex": 5, + "blockNumber": 43292190, + "transactionHash": "0x36ad2add2f65c43afc95a0474b2e9ee32d7c718ffa0833d71824b507b4e4d04d", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + "0x0000000000000000000000005082f249cdb2f2c1ee035e4f423c46ea2dab3ab1" ], - "data": "0x000000000000000000000000000000000000000000000000000f48b5ba261c0000000000000000000000000000000000000000000000000002cc498a684e4e29000000000000000000000000000000000000000000001c510371f7928ee5597b00000000000000000000000000000000000000000000000002bd00d4ae283229000000000000000000000000000000000000000000001c5103814048490b757b", - "logIndex": 4, - "blockHash": "0xf48c483b8d7f95a45e2df4bd56d878855ba99cfd6b70b13551913d318b07e59a" + "data": "0x0000000000000000000000000000000000000000000000000005a8d81ad3220000000000000000000000000000000000000000000000000006fbe7339fdbb264000000000000000000000000000000000000000000000427ffba1b0d05d25b3c00000000000000000000000000000000000000000000000006f63e5b85089064000000000000000000000000000000000000000000000427ffbfc3e520a57d3c", + "logIndex": 15, + "blockHash": "0x19a9c0d499616b972cde19fd5bd238fb8f9fc2d8a16d813bb76e68c02894702d" } ], - "blockNumber": 33096183, - "confirmations": 538553, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1bf133" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x9502f910" }, + "blockNumber": 43292190, + "cumulativeGasUsed": "1453024", "status": 1, - "type": 2, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -617,21 +446,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -654,14 +474,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -687,13 +499,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/polygon-testnet/Api3ServerV1.json b/deployments/polygon-testnet/Api3ServerV1.json index 86ec71df..d1a0ab42 100644 --- a/deployments/polygon-testnet/Api3ServerV1.json +++ b/deployments/polygon-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,21 +741,21 @@ "type": "function" } ], - "transactionHash": "0x510b758b2c4d154c5b798574bf07d22740b1e109f68ae54416ed72027c079656", + "transactionHash": "0xb6a8bc6fadc255e9d00ca38a8acf85c2b2d8d0c311fb3ed9d44c562bf58637f6", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "2960756", + "transactionIndex": 11, + "gasUsed": "2961690", "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000004000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000080000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100040000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x8dd8729540bb138bbdeac7a9eac95512f8d53b7d6e78ee56c42f42aabd8d8615", - "transactionHash": "0x510b758b2c4d154c5b798574bf07d22740b1e109f68ae54416ed72027c079656", + "blockHash": "0x89dde7f129345cedae82f16cd158fa585804778d26f97425b4e59177f8954b6b", + "transactionHash": "0xb6a8bc6fadc255e9d00ca38a8acf85c2b2d8d0c311fb3ed9d44c562bf58637f6", "logs": [ { - "transactionIndex": 3, - "blockNumber": 33191556, - "transactionHash": "0x510b758b2c4d154c5b798574bf07d22740b1e109f68ae54416ed72027c079656", + "transactionIndex": 11, + "blockNumber": 43292193, + "transactionHash": "0xb6a8bc6fadc255e9d00ca38a8acf85c2b2d8d0c311fb3ed9d44c562bf58637f6", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", @@ -763,26 +763,26 @@ "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", "0x000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f" ], - "data": "0x000000000000000000000000000000000000000000000000000fc73016784c000000000000000000000000000000000000000000000000000285d15b05c3f35b000000000000000000000000000000000000000000002ed1893a318e9f4896c700000000000000000000000000000000000000000000000002760a2aef4ba75b000000000000000000000000000000000000000000002ed18949f8beb5c0e2c7", - "logIndex": 10, - "blockHash": "0x8dd8729540bb138bbdeac7a9eac95512f8d53b7d6e78ee56c42f42aabd8d8615" + "data": "0x000000000000000000000000000000000000000000000000000fc8764893c60000000000000000000000000000000000000000000000000006f63e5b8405488400000000000000000000000000000000000000000000356df3245a0e1aee3d5900000000000000000000000000000000000000000000000006e675e53b71828400000000000000000000000000000000000000000000356df334228463820359", + "logIndex": 38, + "blockHash": "0x89dde7f129345cedae82f16cd158fa585804778d26f97425b4e59177f8954b6b" } ], - "blockNumber": 33191556, - "cumulativeGasUsed": "3910085", + "blockNumber": 43292193, + "cumulativeGasUsed": "5329016", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1026,7 +1026,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1034,23 +1034,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1058,7 +1058,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1082,12 +1082,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1103,24 +1103,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1128,7 +1128,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/polygon-testnet/MockErc20PermitToken.json b/deployments/polygon-testnet/MockErc20PermitToken.json deleted file mode 100644 index 239d70dc..00000000 --- a/deployments/polygon-testnet/MockErc20PermitToken.json +++ /dev/null @@ -1,584 +0,0 @@ -{ - "address": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x3797222b0ae432476f3e3dbd2c4b8572e48a54ad9e8310251ab7b1549c862287", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 7, - "gasUsed": "1035406", - "logsBloom": "0x00000080000000020000000000000000000000800000000000000000000000000000000000000000000000000000000000008000000000000000000000100000000000000000000000000008000000800000000000000000000100000008000000000000020000000000000000000800000000000000000080000010000000000000000000000000000000000000000000000000000000000000000000000000200000000000000020000000000000020001000000000000000010000000004000000002000000000001000000000000000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xd09ec5c38347a54c7d9f454b856a7f297b54168c6b33b8f2eb571ac528dc4997", - "transactionHash": "0x3797222b0ae432476f3e3dbd2c4b8572e48a54ad9e8310251ab7b1549c862287", - "logs": [ - { - "transactionIndex": 7, - "blockNumber": 36840089, - "transactionHash": "0x3797222b0ae432476f3e3dbd2c4b8572e48a54ad9e8310251ab7b1549c862287", - "address": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x00000000000000000000000000000000000000000000000000038d7ea4c68000", - "logIndex": 19, - "blockHash": "0xd09ec5c38347a54c7d9f454b856a7f297b54168c6b33b8f2eb571ac528dc4997" - }, - { - "transactionIndex": 7, - "blockNumber": 36840089, - "transactionHash": "0x3797222b0ae432476f3e3dbd2c4b8572e48a54ad9e8310251ab7b1549c862287", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x0000000000000000000000000000000000000000000000000005848b5f99a634000000000000000000000000000000000000000000000000072498ec21a36d1700000000000000000000000000000000000000000000201c30153ff5d8b0dcc4000000000000000000000000000000000000000000000000071f1460c209c6e300000000000000000000000000000000000000000000201c301ac481384a82f8", - "logIndex": 20, - "blockHash": "0xd09ec5c38347a54c7d9f454b856a7f297b54168c6b33b8f2eb571ac528dc4997" - } - ], - "blockNumber": 36840089, - "cumulativeGasUsed": "1925954", - "status": 1, - "byzantium": true - }, - "args": ["0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1"], - "numDeployments": 3, - "solcInputHash": "6e649498aa892726038a27e6a3d82557", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"See {IERC20Permit-DOMAIN_SEPARATOR}.\"},\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"nonces(address)\":{\"details\":\"See {IERC20Permit-nonces}.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"See {IERC20Permit-permit}.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/mock/MockErc20PermitToken.sol\":\"MockErc20PermitToken\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"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/Counters.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n */\\nlibrary Counters {\\n struct Counter {\\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n // this feature: see https://github.com/ethereum/solidity/issues/4637\\n uint256 _value; // default: 0\\n }\\n\\n function current(Counter storage counter) internal view returns (uint256) {\\n return counter._value;\\n }\\n\\n function increment(Counter storage counter) internal {\\n unchecked {\\n counter._value += 1;\\n }\\n }\\n\\n function decrement(Counter storage counter) internal {\\n uint256 value = counter._value;\\n require(value > 0, \\\"Counter: decrement overflow\\\");\\n unchecked {\\n counter._value = value - 1;\\n }\\n }\\n\\n function reset(Counter storage counter) internal {\\n counter._value = 0;\\n }\\n}\\n\",\"keccak256\":\"0xf0018c2440fbe238dd3a8732fa8e17a0f9dce84d31451dc8a32f6d62b349c9f1\",\"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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/utils/mock/MockErc20PermitToken.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Counters.sol\\\";\\n\\n// It is not possible to override the EIP712 version of\\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\\n// so it is copy-pasted below with the version \\\"2\\\" to imitate USDC\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n */\\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\\n using Counters for Counters.Counter;\\n\\n mapping(address => Counters.Counter) private _nonces;\\n\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private constant _PERMIT_TYPEHASH =\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n );\\n /**\\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\\n * However, to ensure consistency with the upgradeable transpiler, we will continue\\n * to reserve a slot.\\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\\n */\\n // solhint-disable-next-line var-name-mixedcase\\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\\n\\n /**\\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n *\\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n */\\n constructor(string memory name) EIP712(name, \\\"2\\\") {}\\n\\n /**\\n * @dev See {IERC20Permit-permit}.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual override {\\n require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n bytes32 structHash = keccak256(\\n abi.encode(\\n _PERMIT_TYPEHASH,\\n owner,\\n spender,\\n value,\\n _useNonce(owner),\\n deadline\\n )\\n );\\n\\n bytes32 hash = _hashTypedDataV4(structHash);\\n\\n address signer = ECDSA.recover(hash, v, r, s);\\n require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n _approve(owner, spender, value);\\n }\\n\\n /**\\n * @dev See {IERC20Permit-nonces}.\\n */\\n function nonces(\\n address owner\\n ) public view virtual override returns (uint256) {\\n return _nonces[owner].current();\\n }\\n\\n /**\\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n return _domainSeparatorV4();\\n }\\n\\n /**\\n * @dev \\\"Consume a nonce\\\": return the current value and increment.\\n *\\n * _Available since v4.1._\\n */\\n function _useNonce(\\n address owner\\n ) internal virtual returns (uint256 current) {\\n Counters.Counter storage nonce = _nonces[owner];\\n current = nonce.current();\\n nonce.increment();\\n }\\n}\\n\\ncontract MockErc20PermitToken is ERC20Permit {\\n constructor(address recipient) ERC20(\\\"Token\\\", \\\"TKN\\\") ERC20Permit(\\\"Token\\\") {\\n _mint(recipient, 1e9 * 10 ** decimals());\\n }\\n\\n function decimals() public view virtual override returns (uint8) {\\n return 6;\\n }\\n}\\n\",\"keccak256\":\"0x414616c15ded0a9d45a35f9f793fd3271677b3a86ef3657e720c33793c9865af\",\"license\":\"UNLICENSED\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b506040516200155e3803806200155e833981016040819052620000359162000257565b604051806040016040528060058152602001642a37b5b2b760d91b81525080604051806040016040528060018152602001601960f91b815250604051806040016040528060058152602001642a37b5b2b760d91b815250604051806040016040528060038152602001622a25a760e91b8152508160039081620000b991906200032d565b506004620000c882826200032d565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c0948501909152815191909601209052929092526101205250620001859050816200016f6006600a6200050e565b6200017f90633b9aca006200051f565b6200018c565b506200054f565b6001600160a01b038216620001e75760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620001fb919062000539565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b6000602082840312156200026a57600080fd5b81516001600160a01b03811681146200028257600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002b457607f821691505b602082108103620002d557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200025257600081815260208120601f850160051c81016020861015620003045750805b601f850160051c820191505b81811015620003255782815560010162000310565b505050505050565b81516001600160401b0381111562000349576200034962000289565b62000361816200035a84546200029f565b84620002db565b602080601f831160018114620003995760008415620003805750858301515b600019600386901b1c1916600185901b17855562000325565b600085815260208120601f198616915b82811015620003ca57888601518255948401946001909101908401620003a9565b5085821015620003e95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000450578160001904821115620004345762000434620003f9565b808516156200044257918102915b93841c939080029062000414565b509250929050565b600082620004695750600162000508565b81620004785750600062000508565b81600181146200049157600281146200049c57620004bc565b600191505062000508565b60ff841115620004b057620004b0620003f9565b50506001821b62000508565b5060208310610133831016604e8410600b8410161715620004e1575081810a62000508565b620004ed83836200040f565b8060001904821115620005045762000504620003f9565b0290505b92915050565b60006200028260ff84168362000458565b8082028115828204841417620005085762000508620003f9565b80820180821115620005085762000508620003f9565b60805160a05160c05160e0516101005161012051610fbf6200059f6000396000610a0401526000610a5301526000610a2e01526000610987015260006109b1015260006109db0152610fbf6000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d7146101c3578063a9059cbb146101d6578063d505accf146101e9578063dd62ed3e146101fe57600080fd5b806370a082311461017f5780637ecebe00146101a857806395d89b41146101bb57600080fd5b806323b872dd116100c857806323b872dd14610142578063313ce567146101555780633644e51514610164578063395093511461016c57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f7610237565b6040516101049190610d86565b60405180910390f35b61012061011b366004610df0565b6102c9565b6040519015158152602001610104565b6002545b604051908152602001610104565b610120610150366004610e1a565b6102e3565b60405160068152602001610104565b610134610307565b61012061017a366004610df0565b610316565b61013461018d366004610e56565b6001600160a01b031660009081526020819052604090205490565b6101346101b6366004610e56565b610355565b6100f7610373565b6101206101d1366004610df0565b610382565b6101206101e4366004610df0565b610431565b6101fc6101f7366004610e78565b61043f565b005b61013461020c366004610eeb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461024690610f1e565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610f1e565b80156102bf5780601f10610294576101008083540402835291602001916102bf565b820191906000526020600020905b8154815290600101906020018083116102a257829003601f168201915b5050505050905090565b6000336102d78185856105a3565b60019150505b92915050565b6000336102f18582856106fb565b6102fc85858561078d565b506001949350505050565b600061031161097a565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102d79082908690610350908790610f52565b6105a3565b6001600160a01b0381166000908152600560205260408120546102dd565b60606004805461024690610f1e565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104245760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102fc82868684036105a3565b6000336102d781858561078d565b8342111561048f5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161041b565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886104be8c610aa1565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061051982610ac9565b9050600061052982878787610b32565b9050896001600160a01b0316816001600160a01b03161461058c5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161041b565b6105978a8a8a6105a3565b50505050505050505050565b6001600160a01b03831661061e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03821661069a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610787578181101561077a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161041b565b61078784848484036105a3565b50505050565b6001600160a01b0383166108095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0382166108855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b038316600090815260208190526040902054818110156109145760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610787565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156109d357507f000000000000000000000000000000000000000000000000000000000000000046145b156109fd57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b60006102dd610ad661097a565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610b4387878787610b5a565b91509150610b5081610c1e565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610b915750600090506003610c15565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610be5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c0e57600060019250925050610c15565b9150600090505b94509492505050565b6000816004811115610c3257610c32610f73565b03610c3a5750565b6001816004811115610c4e57610c4e610f73565b03610c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161041b565b6002816004811115610caf57610caf610f73565b03610cfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161041b565b6003816004811115610d1057610d10610f73565b03610d835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b50565b600060208083528351808285015260005b81811015610db357858101830151858201604001528201610d97565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610deb57600080fd5b919050565b60008060408385031215610e0357600080fd5b610e0c83610dd4565b946020939093013593505050565b600080600060608486031215610e2f57600080fd5b610e3884610dd4565b9250610e4660208501610dd4565b9150604084013590509250925092565b600060208284031215610e6857600080fd5b610e7182610dd4565b9392505050565b600080600080600080600060e0888a031215610e9357600080fd5b610e9c88610dd4565b9650610eaa60208901610dd4565b95506040880135945060608801359350608088013560ff81168114610ece57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610efe57600080fd5b610f0783610dd4565b9150610f1560208401610dd4565b90509250929050565b600181811c90821680610f3257607f821691505b602082108103610ac357634e487b7160e01b600052602260045260246000fd5b808201808211156102dd57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ca24feed64215eac668240d648e7abcb08df77403e9d582f942fc9374e11585764736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d7146101c3578063a9059cbb146101d6578063d505accf146101e9578063dd62ed3e146101fe57600080fd5b806370a082311461017f5780637ecebe00146101a857806395d89b41146101bb57600080fd5b806323b872dd116100c857806323b872dd14610142578063313ce567146101555780633644e51514610164578063395093511461016c57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806318160ddd14610130575b600080fd5b6100f7610237565b6040516101049190610d86565b60405180910390f35b61012061011b366004610df0565b6102c9565b6040519015158152602001610104565b6002545b604051908152602001610104565b610120610150366004610e1a565b6102e3565b60405160068152602001610104565b610134610307565b61012061017a366004610df0565b610316565b61013461018d366004610e56565b6001600160a01b031660009081526020819052604090205490565b6101346101b6366004610e56565b610355565b6100f7610373565b6101206101d1366004610df0565b610382565b6101206101e4366004610df0565b610431565b6101fc6101f7366004610e78565b61043f565b005b61013461020c366004610eeb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461024690610f1e565b80601f016020809104026020016040519081016040528092919081815260200182805461027290610f1e565b80156102bf5780601f10610294576101008083540402835291602001916102bf565b820191906000526020600020905b8154815290600101906020018083116102a257829003601f168201915b5050505050905090565b6000336102d78185856105a3565b60019150505b92915050565b6000336102f18582856106fb565b6102fc85858561078d565b506001949350505050565b600061031161097a565b905090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102d79082908690610350908790610f52565b6105a3565b6001600160a01b0381166000908152600560205260408120546102dd565b60606004805461024690610f1e565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104245760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102fc82868684036105a3565b6000336102d781858561078d565b8342111561048f5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161041b565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886104be8c610aa1565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061051982610ac9565b9050600061052982878787610b32565b9050896001600160a01b0316816001600160a01b03161461058c5760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161041b565b6105978a8a8a6105a3565b50505050505050505050565b6001600160a01b03831661061e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03821661069a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610787578181101561077a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161041b565b61078784848484036105a3565b50505050565b6001600160a01b0383166108095760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b0382166108855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b038316600090815260208190526040902054818110156109145760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161041b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610787565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156109d357507f000000000000000000000000000000000000000000000000000000000000000046145b156109fd57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b60006102dd610ad661097a565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610b4387878787610b5a565b91509150610b5081610c1e565b5095945050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610b915750600090506003610c15565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610be5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c0e57600060019250925050610c15565b9150600090505b94509492505050565b6000816004811115610c3257610c32610f73565b03610c3a5750565b6001816004811115610c4e57610c4e610f73565b03610c9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161041b565b6002816004811115610caf57610caf610f73565b03610cfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161041b565b6003816004811115610d1057610d10610f73565b03610d835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161041b565b50565b600060208083528351808285015260005b81811015610db357858101830151858201604001528201610d97565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610deb57600080fd5b919050565b60008060408385031215610e0357600080fd5b610e0c83610dd4565b946020939093013593505050565b600080600060608486031215610e2f57600080fd5b610e3884610dd4565b9250610e4660208501610dd4565b9150604084013590509250925092565b600060208284031215610e6857600080fd5b610e7182610dd4565b9392505050565b600080600080600080600060e0888a031215610e9357600080fd5b610e9c88610dd4565b9650610eaa60208901610dd4565b95506040880135945060608801359350608088013560ff81168114610ece57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610efe57600080fd5b610f0783610dd4565b9150610f1560208401610dd4565b90509250929050565b600181811c90821680610f3257607f821691505b602082108103610ac357634e487b7160e01b600052602260045260246000fd5b808201808211156102dd57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220ca24feed64215eac668240d648e7abcb08df77403e9d582f942fc9374e11585764736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "DOMAIN_SEPARATOR()": { - "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." - }, - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "nonces(address)": { - "details": "See {IERC20Permit-nonces}." - }, - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { - "details": "See {IERC20Permit-permit}." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 2399, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_nonces", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_struct(Counter)753_storage)" - }, - { - "astId": 2407, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", - "offset": 0, - "slot": "6", - "type": "t_bytes32" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_struct(Counter)753_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Counters.Counter)", - "numberOfBytes": "32", - "value": "t_struct(Counter)753_storage" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Counter)753_storage": { - "encoding": "inplace", - "label": "struct Counters.Counter", - "members": [ - { - "astId": 752, - "contract": "contracts/utils/mock/MockErc20PermitToken.sol:MockErc20PermitToken", - "label": "_value", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/deployments/polygon-testnet/PrepaymentDepository.json b/deployments/polygon-testnet/PrepaymentDepository.json deleted file mode 100644 index d0e9697f..00000000 --- a/deployments/polygon-testnet/PrepaymentDepository.json +++ /dev/null @@ -1,983 +0,0 @@ -{ - "address": "0x7A175B0C798bDD6C0Ea10C9d82dcd40a05e0F672", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_accessControlRegistry", - "type": "address" - }, - { - "internalType": "string", - "name": "_adminRoleDescription", - "type": "string" - }, - { - "internalType": "address", - "name": "_manager", - "type": "address" - }, - { - "internalType": "address", - "name": "_token", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Claimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "DecreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "IncreasedUserWithdrawalLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "SetWithdrawalDestination", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "withdrawalHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "name": "Withdrew", - "type": "event" - }, - { - "inputs": [], - "name": "CLAIMER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WITHDRAWAL_SIGNER_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": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "applyPermitAndDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "claimerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "decreaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "increaseUserWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "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": "user", - "type": "address" - }, - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - } - ], - "name": "setWithdrawalDestination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalDestination", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userToWithdrawalLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitDecreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "userWithdrawalLimitIncreaserRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - }, - { - "internalType": "address", - "name": "withdrawalSigner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "withdraw", - "outputs": [ - { - "internalType": "address", - "name": "withdrawalDestination", - "type": "address" - }, - { - "internalType": "uint256", - "name": "withdrawalLimit", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalSignerRole", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "withdrawalWithHashIsExecuted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x18e57cddf570d5dc6af913dfde2ed300bc8da45bb5dd1b57230f1580ce3ad503", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "2040245", - "logsBloom": "0x00000080000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000020000000000000020001000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xe5db97ee3707864670fda11a6cca80a235c77fcad56cbc51d1d9589349118492", - "transactionHash": "0x18e57cddf570d5dc6af913dfde2ed300bc8da45bb5dd1b57230f1580ce3ad503", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 36840093, - "transactionHash": "0x18e57cddf570d5dc6af913dfde2ed300bc8da45bb5dd1b57230f1580ce3ad503", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x00000000000000000000000000000000000000000000000000140edd185ee274000000000000000000000000000000000000000000000000071f1460c0ed64e700000000000000000000000000000000000000000000201c338705e292d0bf73000000000000000000000000000000000000000000000000070b0583a88e827300000000000000000000000000000000000000000000201c339b14bfab2fa1e7", - "logIndex": 1, - "blockHash": "0xe5db97ee3707864670fda11a6cca80a235c77fcad56cbc51d1d9589349118492" - } - ], - "blockNumber": 36840093, - "cumulativeGasUsed": "2085914", - "status": 1, - "byzantium": true - }, - "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "PrepaymentDepository admin (OEV Relay)", - "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9" - ], - "numDeployments": 3, - "solcInputHash": "07bb4c0d5cdd8840a822dc1d7ed83326", - "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\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Claimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"DecreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"IncreasedUserWithdrawalLimit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"SetWithdrawalDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"withdrawalHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CLAIMER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWAL_SIGNER_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\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"applyPermitAndDeposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"decreaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseUserWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"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\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"}],\"name\":\"setWithdrawalDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalDestination\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"userToWithdrawalLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitDecreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"userWithdrawalLimitIncreaserRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"withdrawalSigner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"withdrawalDestination\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawalLimit\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalSignerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"withdrawalWithHashIsExecuted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"deadline\":\"Deadline of the permit\",\"r\":\"r component of the signature\",\"s\":\"s component of the signature\",\"user\":\"User address\",\"v\":\"v component of the signature\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"claim(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to claim\",\"recipient\":\"Recipient address\"}},\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\",\"_token\":\"Contract address of the ERC20 token that prepayments are made in\"}},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"params\":{\"amount\":\"Amount to decrease the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Decreased withdrawal limit\"}},\"deposit(address,uint256)\":{\"params\":{\"amount\":\"Amount of tokens to deposit\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"increaseUserWithdrawalLimit(address,uint256)\":{\"details\":\"This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls\",\"params\":{\"amount\":\"Amount to increase the withdrawal limit by\",\"user\":\"User address\"},\"returns\":{\"withdrawalLimit\":\"Increased withdrawal limit\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"setWithdrawalDestination(address,address)\":{\"params\":{\"user\":\"User address\",\"withdrawalDestination\":\"Withdrawal destination\"}},\"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(uint256,uint256,address,bytes)\":{\"params\":{\"amount\":\"Amount of tokens to withdraw\",\"expirationTimestamp\":\"Expiration timestamp of the signature\",\"signature\":\"Withdrawal signature\",\"withdrawalSigner\":\"Address of the account that signed the withdrawal\"},\"returns\":{\"withdrawalDestination\":\"Withdrawal destination\",\"withdrawalLimit\":\"Decreased withdrawal limit\"}}},\"title\":\"Contract that enables micropayments to be prepaid in batch\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"CLAIMER_ROLE_DESCRIPTION()\":{\"notice\":\"Claimer role description\"},\"USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit decreaser role description\"},\"USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\":{\"notice\":\"User withdrawal limit increaser role description\"},\"WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawal signer role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"notice\":\"Called to apply a ERC2612 permit and deposit tokens on behalf of a user\"},\"claim(address,uint256)\":{\"notice\":\"Called to claim tokens\"},\"claimerRole()\":{\"notice\":\"Claimer role\"},\"decreaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to decrease the withdrawal limit of the user\"},\"deposit(address,uint256)\":{\"notice\":\"Called to deposit tokens on behalf of a user\"},\"increaseUserWithdrawalLimit(address,uint256)\":{\"notice\":\"Called to increase the withdrawal limit of the user\"},\"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\"},\"setWithdrawalDestination(address,address)\":{\"notice\":\"Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination\"},\"token()\":{\"notice\":\"Contract address of the ERC20 token that prepayments can be made in\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"userToWithdrawalDestination(address)\":{\"notice\":\"Returns the withdrawal destination of the user\"},\"userToWithdrawalLimit(address)\":{\"notice\":\"Returns the withdrawal limit of the user\"},\"userWithdrawalLimitDecreaserRole()\":{\"notice\":\"User withdrawal limit decreaser role\"},\"userWithdrawalLimitIncreaserRole()\":{\"notice\":\"User withdrawal limit increaser role\"},\"withdraw(uint256,uint256,address,bytes)\":{\"notice\":\"Called by a user to withdraw tokens\"},\"withdrawalSignerRole()\":{\"notice\":\"Withdrawal signer role\"},\"withdrawalWithHashIsExecuted(bytes32)\":{\"notice\":\"Returns if the withdrawal with the hash is executed\"}},\"notice\":\"`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/PrepaymentDepository.sol\":\"PrepaymentDepository\"},\"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/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/PrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./interfaces/IPrepaymentDepository.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\n/// @title Contract that enables micropayments to be prepaid in batch\\n/// @notice `manager` represents the payment recipient, and its various\\n/// privileges can be delegated to other accounts through respective roles.\\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\\n/// be granted to a multisig or an equivalently decentralized account.\\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\\n/// being compromised poses a risk in proportion to the redundancy in user\\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\\n/// withdrawal limits as necessary to mitigate this risk.\\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\\n/// cannot cause irreversible harm.\\n/// This contract accepts prepayments in an ERC20 token specified immutably\\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\\n/// An optional `depositWithPermit()` function is added to provide ERC2612\\n/// support.\\ncontract PrepaymentDepository is\\n AccessControlRegistryAdminnedWithManager,\\n IPrepaymentDepository\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Withdrawal signer role description\\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\\n \\\"Withdrawal signer\\\";\\n /// @notice User withdrawal limit increaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit increaser\\\";\\n /// @notice User withdrawal limit decreaser role description\\n string\\n public constant\\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\\n \\\"User withdrawal limit decreaser\\\";\\n /// @notice Claimer role description\\n string public constant override CLAIMER_ROLE_DESCRIPTION = \\\"Claimer\\\";\\n\\n // We prefer revert strings over custom errors because not all chains and\\n // block explorers support custom errors\\n string private constant AMOUNT_ZERO_REVERT_STRING = \\\"Amount zero\\\";\\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\\n \\\"Amount exceeds limit\\\";\\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\\n \\\"Transfer unsuccessful\\\";\\n\\n /// @notice Withdrawal signer role\\n bytes32 public immutable override withdrawalSignerRole;\\n /// @notice User withdrawal limit increaser role\\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\\n /// @notice User withdrawal limit decreaser role\\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\\n /// @notice Claimer role\\n bytes32 public immutable override claimerRole;\\n\\n /// @notice Contract address of the ERC20 token that prepayments can be\\n /// made in\\n address public immutable override token;\\n\\n /// @notice Returns the withdrawal destination of the user\\n mapping(address => address) public userToWithdrawalDestination;\\n\\n /// @notice Returns the withdrawal limit of the user\\n mapping(address => uint256) public userToWithdrawalLimit;\\n\\n /// @notice Returns if the withdrawal with the hash is executed\\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\\n\\n /// @param user User address\\n /// @param amount Amount\\n /// @dev Reverts if user address or amount is zero\\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\\n require(user != address(0), \\\"User address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n _;\\n }\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n /// @param _token Contract address of the ERC20 token that prepayments are\\n /// made in\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager,\\n address _token\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n require(_token != address(0), \\\"Token address zero\\\");\\n token = _token;\\n withdrawalSignerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitIncreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\\n );\\n userWithdrawalLimitDecreaserRole = _deriveRole(\\n _deriveAdminRole(manager),\\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\\n );\\n claimerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n CLAIMER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Called by the user that has not set a withdrawal destination to\\n /// set a withdrawal destination, or called by the withdrawal destination\\n /// of a user to set a new withdrawal destination\\n /// @param user User address\\n /// @param withdrawalDestination Withdrawal destination\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external override {\\n require(user != withdrawalDestination, \\\"Same user and destination\\\");\\n require(\\n (msg.sender == user &&\\n userToWithdrawalDestination[user] == address(0)) ||\\n (msg.sender == userToWithdrawalDestination[user]),\\n \\\"Sender not destination\\\"\\n );\\n userToWithdrawalDestination[user] = withdrawalDestination;\\n emit SetWithdrawalDestination(user, withdrawalDestination);\\n }\\n\\n /// @notice Called to increase the withdrawal limit of the user\\n /// @dev This function is intended to be used to revert faulty\\n /// `decreaseUserWithdrawalLimit()` calls\\n /// @param user User address\\n /// @param amount Amount to increase the withdrawal limit by\\n /// @return withdrawalLimit Increased withdrawal limit\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitIncreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot increase withdrawal limit\\\"\\n );\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit IncreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to decrease the withdrawal limit of the user\\n /// @param user User address\\n /// @param amount Amount to decrease the withdrawal limit by\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n )\\n external\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n userWithdrawalLimitDecreaserRole,\\n msg.sender\\n ),\\n \\\"Cannot decrease withdrawal limit\\\"\\n );\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit DecreasedUserWithdrawalLimit(\\n user,\\n amount,\\n withdrawalLimit,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called to claim tokens\\n /// @param recipient Recipient address\\n /// @param amount Amount of tokens to claim\\n function claim(address recipient, uint256 amount) external override {\\n require(recipient != address(0), \\\"Recipient address zero\\\");\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n claimerRole,\\n msg.sender\\n ),\\n \\\"Cannot claim\\\"\\n );\\n emit Claimed(recipient, amount, msg.sender);\\n require(\\n IERC20(token).transfer(recipient, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to deposit tokens on behalf of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @return withdrawalLimit Increased withdrawal limit\\n function deposit(\\n address user,\\n uint256 amount\\n )\\n public\\n override\\n onlyNonZeroUserAddressAndAmount(user, amount)\\n returns (uint256 withdrawalLimit)\\n {\\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\\n userToWithdrawalLimit[user] = withdrawalLimit;\\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\\n require(\\n IERC20(token).transferFrom(msg.sender, address(this), amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n\\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\\n /// of a user\\n /// @param user User address\\n /// @param amount Amount of tokens to deposit\\n /// @param deadline Deadline of the permit\\n /// @param v v component of the signature\\n /// @param r r component of the signature\\n /// @param s s component of the signature\\n /// @return withdrawalLimit Increased withdrawal limit\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external override returns (uint256 withdrawalLimit) {\\n IERC20Permit(token).permit(\\n msg.sender,\\n address(this),\\n amount,\\n deadline,\\n v,\\n r,\\n s\\n );\\n withdrawalLimit = deposit(user, amount);\\n }\\n\\n /// @notice Called by a user to withdraw tokens\\n /// @param amount Amount of tokens to withdraw\\n /// @param expirationTimestamp Expiration timestamp of the signature\\n /// @param withdrawalSigner Address of the account that signed the\\n /// withdrawal\\n /// @param signature Withdrawal signature\\n /// @return withdrawalDestination Withdrawal destination\\n /// @return withdrawalLimit Decreased withdrawal limit\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n )\\n external\\n override\\n returns (address withdrawalDestination, uint256 withdrawalLimit)\\n {\\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\\n require(block.timestamp < expirationTimestamp, \\\"Signature expired\\\");\\n bytes32 withdrawalHash = keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n msg.sender,\\n amount,\\n expirationTimestamp\\n )\\n );\\n require(\\n !withdrawalWithHashIsExecuted[withdrawalHash],\\n \\\"Withdrawal already executed\\\"\\n );\\n require(\\n withdrawalSigner == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n withdrawalSignerRole,\\n withdrawalSigner\\n ),\\n \\\"Cannot sign withdrawal\\\"\\n );\\n require(\\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\\n withdrawalSigner,\\n \\\"Signature mismatch\\\"\\n );\\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\\n require(\\n amount <= oldWithdrawalLimit,\\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\\n );\\n withdrawalLimit = oldWithdrawalLimit - amount;\\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\\n withdrawalDestination = msg.sender;\\n } else {\\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\\n }\\n emit Withdrew(\\n msg.sender,\\n withdrawalHash,\\n amount,\\n expirationTimestamp,\\n withdrawalSigner,\\n withdrawalDestination,\\n withdrawalLimit\\n );\\n require(\\n IERC20(token).transfer(withdrawalDestination, amount),\\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\\n );\\n }\\n}\\n\",\"keccak256\":\"0x74314a7fbed41c4bb318a24b7c2cb104f2fea2211f43d03f76aead2ad3858052\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IPrepaymentDepository.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\\n event SetWithdrawalDestination(\\n address indexed user,\\n address withdrawalDestination\\n );\\n\\n event IncreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event DecreasedUserWithdrawalLimit(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Claimed(address recipient, uint256 amount, address sender);\\n\\n event Deposited(\\n address indexed user,\\n uint256 amount,\\n uint256 withdrawalLimit,\\n address sender\\n );\\n\\n event Withdrew(\\n address indexed user,\\n bytes32 indexed withdrawalHash,\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n address withdrawalDestination,\\n uint256 withdrawalLimit\\n );\\n\\n function setWithdrawalDestination(\\n address user,\\n address withdrawalDestination\\n ) external;\\n\\n function increaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function decreaseUserWithdrawalLimit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function claim(address recipient, uint256 amount) external;\\n\\n function deposit(\\n address user,\\n uint256 amount\\n ) external returns (uint256 withdrawalLimit);\\n\\n function applyPermitAndDeposit(\\n address user,\\n uint256 amount,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external returns (uint256 withdrawalLimit);\\n\\n function withdraw(\\n uint256 amount,\\n uint256 expirationTimestamp,\\n address withdrawalSigner,\\n bytes calldata signature\\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\\n\\n function withdrawalSignerRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\\n\\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\\n\\n function claimerRole() external view returns (bytes32);\\n\\n function token() external view returns (address);\\n}\\n\",\"keccak256\":\"0x15ec7b40b9be1ea7ca88b39d6a8a5a94f213977565c6b754ad4b2f5ffb7b9710\",\"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": "0x6101a06040523480156200001257600080fd5b50604051620029e2380380620029e2833981016040819052620000359162000468565b83838382826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620005ea565b50806040516020016200010b9190620006b6565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000326565b60e0525050506001600160a01b038116620001eb5760405162461bcd60e51b8152602060048201526012602482015271546f6b656e2061646472657373207a65726f60701b604482015260640162000080565b6001600160a01b0381166101805260c0516200023a906200020c9062000326565b6040805180820190915260118152702bb4ba34323930bbb0b61039b4b3b732b960791b6020820152620003a0565b6101005260c0516200028b90620002519062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420696e63726561736572006020820152620003a0565b6101205260c051620002dc90620002a29062000326565b60408051808201909152601f81527f55736572207769746864726177616c206c696d697420646563726561736572006020820152620003a0565b6101405260c0516200031790620002f39062000326565b60408051808201909152600781526621b630b4b6b2b960c91b6020820152620003a0565b6101605250620006d492505050565b60006200039a6200036b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620003dc8383604051602001620003ba9190620006b6565b60405160208183030381529060405280519060200120620003e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200042757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200045f57818101518382015260200162000445565b50506000910152565b600080600080608085870312156200047f57600080fd5b6200048a856200040f565b60208601519094506001600160401b0380821115620004a857600080fd5b818701915087601f830112620004bd57600080fd5b815181811115620004d257620004d26200042c565b604051601f8201601f19908116603f01168101908382118183101715620004fd57620004fd6200042c565b816040528281528a60208487010111156200051757600080fd5b6200052a83602083016020880162000442565b809750505050505062000540604086016200040f565b915062000550606086016200040f565b905092959194509250565b600181811c908216806200057057607f821691505b6020821081036200059157634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005e557600081815260208120601f850160051c81016020861015620005c05750805b601f850160051c820191505b81811015620005e157828155600101620005cc565b5050505b505050565b81516001600160401b038111156200060657620006066200042c565b6200061e816200061784546200055b565b8462000597565b602080601f8311600181146200065657600084156200063d5750858301515b600019600386901b1c1916600185901b178555620005e1565b600085815260208120601f198616915b82811015620006875788860151825594840194600190910190840162000666565b5085821015620006a65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620006ca81846020870162000442565b9190910192915050565b60805160a05160c05160e0516101005161012051610140516101605161018051612230620007b2600039600081816105500152818161082b01528181610c8901528181610f3301526119d70152600081816103fd0152610dda0152600081816101e60152610a5b015260008181610367015261124a0152600081816103a101526116e4015260006101ac0152600081816102fc01528181610a2501528181610da401528181611214015261169c0152600050506000818161024001528181610a8701528181610e0601528181611276015261171a01526122306000f3fe608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a25760003560e01c80639358e157116100ee578063c16ad0ea11610097578063ea6dfa4b11610071578063ea6dfa4b146104bd578063eeaf32c3146104ef578063f51ac6491461050f578063fc0c546a1461054b57600080fd5b8063c16ad0ea14610432578063e67b88411461046e578063e7fa22861461048157600080fd5b8063ac9650d8116100c8578063ac9650d8146103d8578063b5d4da10146103f8578063bc4ee9be1461041f57600080fd5b80639358e157146103895780639d2118581461039c578063aad3ec96146103c357600080fd5b806347e7ef24116101505780637d5fd8ac1161012a5780637d5fd8ac1461032657806381b8519e14610339578063879e25371461036257600080fd5b806347e7ef24146102e4578063481c6a75146102f75780634c8f1d8d1461031e57600080fd5b80631ce9ae07116101815780631ce9ae071461023b5780632e09739d1461027a578063437b9116146102c357600080fd5b80629f2f3c146101a7578063103606b6146101e1578063114df56414610208575b600080fd5b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b61022b610216366004611d8f565b60036020526000908152604090205460ff1681565b60405190151581526020016101d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d8565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d6974206465637265617365720081525081565b6040516101d89190611dee565b6102d66102d1366004611e08565b610572565b6040516101d8929190611ed5565b6101ce6102f2366004611f4a565b6106d8565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b6102b66108fd565b6101ce610334366004611f4a565b61098b565b610262610347366004611f74565b6001602052600090815260409020546001600160a01b031681565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce610397366004611f8f565b610c2d565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6103d66103d1366004611f4a565b610d02565b005b6103eb6103e6366004611e08565b610ff9565b6040516101d89190611fef565b6101ce7f000000000000000000000000000000000000000000000000000000000000000081565b6101ce61042d366004611f4a565b61117a565b6102b66040518060400160405280601f81526020017f55736572207769746864726177616c206c696d697420696e637265617365720081525081565b6103d661047c366004612002565b6113c1565b6102b66040518060400160405280601181526020017f5769746864726177616c207369676e657200000000000000000000000000000081525081565b6104d06104cb366004612035565b611541565b604080516001600160a01b0390931683526020830191909152016101d8565b6101ce6104fd366004611f74565b60026020526000908152604090205481565b6102b66040518060400160405280600781526020017f436c61696d65720000000000000000000000000000000000000000000000000081525081565b6102627f000000000000000000000000000000000000000000000000000000000000000081565b606080828067ffffffffffffffff81111561058f5761058f6120c9565b6040519080825280602002602001820160405280156105b8578160200160208202803683370190505b5092508067ffffffffffffffff8111156105d4576105d46120c9565b60405190808252806020026020018201604052801561060757816020015b60608152602001906001900390816105f25790505b50915060005b818110156106cf5730868683818110610628576106286120df565b905060200281019061063a91906120f5565b60405161064892919061213c565b600060405180830381855af49150503d8060008114610683576040519150601f19603f3d011682016040523d82523d6000602084013e610688565b606091505b5085838151811061069b5761069b6120df565b602002602001018584815181106106b4576106b46120df565b6020908102919091010191909152901515905260010161060d565b50509250929050565b600082826001600160a01b03821661072b5760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b60448201526064015b60405180910390fd5b60408051808201909152600b81526a416d6f756e74207a65726f60a81b60208201528161076b5760405162461bcd60e51b81526004016107229190611dee565b506001600160a01b038516600090815260026020526040902054610790908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917fa49637e3f6491de6c2c23c5006bef69df603d0dba9d65c8b756fe46ac29810b99181900360600190a26040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af115801561087c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c0000000000000000000000815250906108f45760405162461bcd60e51b81526004016107229190611dee565b50505092915050565b6000805461090a90612197565b80601f016020809104026020016040519081016040528092919081815260200182805461093690612197565b80156109835780601f1061095857610100808354040283529160200191610983565b820191906000526020600020905b81548152906001019060200180831161096657829003601f168201915b505050505081565b600082826001600160a01b0382166109d95760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610a195760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610afa5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afa9190612175565b610b465760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f74206465637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020908152604091829020548251808401909352601483527f416d6f756e742065786365656473206c696d6974000000000000000000000000918301919091529081861115610bb95760405162461bcd60e51b81526004016107229190611dee565b50610bc485826121d1565b6001600160a01b03871660008181526002602090815260409182902084905581518981529081018490523381830152905192965090917f335d9b077520694d15541750c263be116d6ed7ac66a59598c98339fd182b68839181900360600190a250505092915050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e401600060405180830381600087803b158015610cd557600080fd5b505af1158015610ce9573d6000803e3d6000fd5b50505050610cf787876106d8565b979650505050505050565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152601660248201527f526563697069656e742061646472657373207a65726f000000000000000000006044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b602082015281610d985760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610e795750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e799190612175565b610ec55760405162461bcd60e51b815260206004820152600c60248201527f43616e6e6f7420636c61696d00000000000000000000000000000000000000006044820152606401610722565b604080516001600160a01b038416815260208101839052338183015290517f7e6632ca16a0ac6cf28448500b1a17d96c8b8163ad4c4a9b44ef5386cc02779e9181900360600190a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa09190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090610ff45760405162461bcd60e51b81526004016107229190611dee565b505050565b6060818067ffffffffffffffff811115611015576110156120c9565b60405190808252806020026020018201604052801561104857816020015b60608152602001906001900390816110335790505b50915060005b818110156111725760003086868481811061106b5761106b6120df565b905060200281019061107d91906120f5565b60405161108b92919061213c565b600060405180830381855af49150503d80600081146110c6576040519150601f19603f3d011682016040523d82523d6000602084013e6110cb565b606091505b508584815181106110de576110de6120df565b6020908102919091010152905080611169576000848381518110611104576111046120df565b602002602001015190506000815111156111215780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610722565b5060010161104e565b505092915050565b600082826001600160a01b0382166111c85760405162461bcd60e51b8152602060048201526011602482015270557365722061646472657373207a65726f60781b6044820152606401610722565b60408051808201909152600b81526a416d6f756e74207a65726f60a81b6020820152816112085760405162461bcd60e51b81526004016107229190611dee565b50336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806112e95750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa1580156112c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e99190612175565b6113355760405162461bcd60e51b815260206004820181905260248201527f43616e6e6f7420696e637265617365207769746864726177616c206c696d69746044820152606401610722565b6001600160a01b038516600090815260026020526040902054611359908590612162565b6001600160a01b03861660008181526002602090815260409182902084905581518881529081018490523381830152905192955090917f3b7d792e260458e1c177def1e07111f7f7830f011d2ff9621aced2f602f7b3e39181900360600190a2505092915050565b806001600160a01b0316826001600160a01b0316036114225760405162461bcd60e51b815260206004820152601960248201527f53616d65207573657220616e642064657374696e6174696f6e000000000000006044820152606401610722565b336001600160a01b03831614801561145257506001600160a01b0382811660009081526001602052604090205416155b8061147657506001600160a01b038281166000908152600160205260409020541633145b6114c25760405162461bcd60e51b815260206004820152601660248201527f53656e646572206e6f742064657374696e6174696f6e000000000000000000006044820152606401610722565b6001600160a01b0382811660008181526001602090815260409182902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169486169485179055905192835290917f9dd95d02717bf7571007d03882b61fe2f94cc2b7700b4b88b1d59a5b995414c9910160405180910390a25050565b60008086600014156040518060400160405280600b81526020016a416d6f756e74207a65726f60a81b8152509061158b5760405162461bcd60e51b81526004016107229190611dee565b508542106115db5760405162461bcd60e51b815260206004820152601160248201527f5369676e617475726520657870697265640000000000000000000000000000006044820152606401610722565b604080514660208201526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018890526088810187905260009060a80160408051601f1981840301815291815281516020928301206000818152600390935291205490915060ff161561169a5760405162461bcd60e51b815260206004820152601b60248201527f5769746864726177616c20616c726561647920657865637574656400000000006044820152606401610722565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614806117855750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0387811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612175565b6117d15760405162461bcd60e51b815260206004820152601660248201527f43616e6e6f74207369676e207769746864726177616c000000000000000000006044820152606401610722565b856001600160a01b031661182686868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118209250869150611aa59050565b90611af8565b6001600160a01b03161461187c5760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610722565b6000818152600360209081526040808320805460ff191660011790553383526002825291829020548251808401909352601483527f416d6f756e742065786365656473206c696d69740000000000000000000000009183019190915290818a11156118fa5760405162461bcd60e51b81526004016107229190611dee565b5061190589826121d1565b33600090815260026020908152604080832084905560019091529020549093506001600160a01b031661193a57339350611956565b336000908152600160205260409020546001600160a01b031693505b604080518a8152602081018a90526001600160a01b038981168284015286166060820152608081018590529051839133917f26b54a250815ecc9a950e4e58faf8b45be2340e5b1e3cab54f466cea24f1d5e89181900360a00190a360405163a9059cbb60e01b81526001600160a01b038581166004830152602482018b90527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015611a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a449190612175565b6040518060400160405280601581526020017f5472616e7366657220756e7375636365737366756c000000000000000000000081525090611a985760405162461bcd60e51b81526004016107229190611dee565b5050509550959350505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b6000806000611b078585611b1e565b91509150611b1481611b63565b5090505b92915050565b6000808251604103611b545760208301516040840151606085015160001a611b4887828585611ccb565b94509450505050611b5c565b506000905060025b9250929050565b6000816004811115611b7757611b776121e4565b03611b7f5750565b6001816004811115611b9357611b936121e4565b03611be05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610722565b6002816004811115611bf457611bf46121e4565b03611c415760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610722565b6003816004811115611c5557611c556121e4565b03611cc85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610722565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d025750600090506003611d86565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d56573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d7f57600060019250925050611d86565b9150600090505b94509492505050565b600060208284031215611da157600080fd5b5035919050565b6000815180845260005b81811015611dce57602081850181015186830182015201611db2565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611e016020830184611da8565b9392505050565b60008060208385031215611e1b57600080fd5b823567ffffffffffffffff80821115611e3357600080fd5b818501915085601f830112611e4757600080fd5b813581811115611e5657600080fd5b8660208260051b8501011115611e6b57600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b84811015611ec857601f19868403018952611eb6838351611da8565b98840198925090830190600101611e9a565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611f10578151151584529284019290840190600101611ef2565b50505083810382850152611f248186611e7d565b9695505050505050565b80356001600160a01b0381168114611f4557600080fd5b919050565b60008060408385031215611f5d57600080fd5b611f6683611f2e565b946020939093013593505050565b600060208284031215611f8657600080fd5b611e0182611f2e565b60008060008060008060c08789031215611fa857600080fd5b611fb187611f2e565b95506020870135945060408701359350606087013560ff81168114611fd557600080fd5b9598949750929560808101359460a0909101359350915050565b602081526000611e016020830184611e7d565b6000806040838503121561201557600080fd5b61201e83611f2e565b915061202c60208401611f2e565b90509250929050565b60008060008060006080868803121561204d57600080fd5b853594506020860135935061206460408701611f2e565b9250606086013567ffffffffffffffff8082111561208157600080fd5b818801915088601f83011261209557600080fd5b8135818111156120a457600080fd5b8960208285010111156120b657600080fd5b9699959850939650602001949392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261210c57600080fd5b83018035915067ffffffffffffffff82111561212757600080fd5b602001915036819003821315611b5c57600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b1857611b1861214c565b60006020828403121561218757600080fd5b81518015158114611e0157600080fd5b600181811c908216806121ab57607f821691505b6020821081036121cb57634e487b7160e01b600052602260045260246000fd5b50919050565b81810381811115611b1857611b1861214c565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b1951b2346a2067d78e9b91c0e17e38ea6486fde9cf92d10cf25d6f03072fff064736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "params": { - "amount": "Amount of tokens to deposit", - "deadline": "Deadline of the permit", - "r": "r component of the signature", - "s": "s component of the signature", - "user": "User address", - "v": "v component of the signature" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "claim(address,uint256)": { - "params": { - "amount": "Amount of tokens to claim", - "recipient": "Recipient address" - } - }, - "constructor": { - "params": { - "_accessControlRegistry": "AccessControlRegistry contract address", - "_adminRoleDescription": "Admin role description", - "_manager": "Manager address", - "_token": "Contract address of the ERC20 token that prepayments are made in" - } - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "params": { - "amount": "Amount to decrease the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Decreased withdrawal limit" - } - }, - "deposit(address,uint256)": { - "params": { - "amount": "Amount of tokens to deposit", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "details": "This function is intended to be used to revert faulty `decreaseUserWithdrawalLimit()` calls", - "params": { - "amount": "Amount to increase the withdrawal limit by", - "user": "User address" - }, - "returns": { - "withdrawalLimit": "Increased withdrawal limit" - } - }, - "multicall(bytes[])": { - "params": { - "data": "Array of calldata of batched calls" - }, - "returns": { - "returndata": "Array of returndata of batched calls" - } - }, - "setWithdrawalDestination(address,address)": { - "params": { - "user": "User address", - "withdrawalDestination": "Withdrawal destination" - } - }, - "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(uint256,uint256,address,bytes)": { - "params": { - "amount": "Amount of tokens to withdraw", - "expirationTimestamp": "Expiration timestamp of the signature", - "signature": "Withdrawal signature", - "withdrawalSigner": "Address of the account that signed the withdrawal" - }, - "returns": { - "withdrawalDestination": "Withdrawal destination", - "withdrawalLimit": "Decreased withdrawal limit" - } - } - }, - "title": "Contract that enables micropayments to be prepaid in batch", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "CLAIMER_ROLE_DESCRIPTION()": { - "notice": "Claimer role description" - }, - "USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit decreaser role description" - }, - "USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()": { - "notice": "User withdrawal limit increaser role description" - }, - "WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()": { - "notice": "Withdrawal signer role description" - }, - "accessControlRegistry()": { - "notice": "AccessControlRegistry contract address" - }, - "adminRole()": { - "notice": "Admin role" - }, - "adminRoleDescription()": { - "notice": "Admin role description" - }, - "applyPermitAndDeposit(address,uint256,uint256,uint8,bytes32,bytes32)": { - "notice": "Called to apply a ERC2612 permit and deposit tokens on behalf of a user" - }, - "claim(address,uint256)": { - "notice": "Called to claim tokens" - }, - "claimerRole()": { - "notice": "Claimer role" - }, - "decreaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to decrease the withdrawal limit of the user" - }, - "deposit(address,uint256)": { - "notice": "Called to deposit tokens on behalf of a user" - }, - "increaseUserWithdrawalLimit(address,uint256)": { - "notice": "Called to increase the withdrawal limit of the user" - }, - "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" - }, - "setWithdrawalDestination(address,address)": { - "notice": "Called by the user that has not set a withdrawal destination to set a withdrawal destination, or called by the withdrawal destination of a user to set a new withdrawal destination" - }, - "token()": { - "notice": "Contract address of the ERC20 token that prepayments can be made in" - }, - "tryMulticall(bytes[])": { - "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" - }, - "userToWithdrawalDestination(address)": { - "notice": "Returns the withdrawal destination of the user" - }, - "userToWithdrawalLimit(address)": { - "notice": "Returns the withdrawal limit of the user" - }, - "userWithdrawalLimitDecreaserRole()": { - "notice": "User withdrawal limit decreaser role" - }, - "userWithdrawalLimitIncreaserRole()": { - "notice": "User withdrawal limit increaser role" - }, - "withdraw(uint256,uint256,address,bytes)": { - "notice": "Called by a user to withdraw tokens" - }, - "withdrawalSignerRole()": { - "notice": "Withdrawal signer role" - }, - "withdrawalWithHashIsExecuted(bytes32)": { - "notice": "Returns if the withdrawal with the hash is executed" - } - }, - "notice": "`manager` represents the payment recipient, and its various privileges can be delegated to other accounts through respective roles. `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only be granted to a multisig or an equivalently decentralized account. `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It being compromised poses a risk in proportion to the redundancy in user withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user withdrawal limits as necessary to mitigate this risk. The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it cannot cause irreversible harm. This contract accepts prepayments in an ERC20 token specified immutably during construction. Do not use tokens that are not fully ERC20-compliant. An optional `depositWithPermit()` function is added to provide ERC2612 support.", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6929, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "adminRoleDescription", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 18952, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalDestination", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_address)" - }, - { - "astId": 18957, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "userToWithdrawalLimit", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 18962, - "contract": "contracts/utils/PrepaymentDepository.sol:PrepaymentDepository", - "label": "withdrawalWithHashIsExecuted", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_bytes32,t_bool)" - } - ], - "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_address)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "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_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} diff --git a/deployments/polygon-testnet/ProxyFactory.json b/deployments/polygon-testnet/ProxyFactory.json index c9de6262..24cbe0bf 100644 --- a/deployments/polygon-testnet/ProxyFactory.json +++ b/deployments/polygon-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,21 +350,21 @@ "type": "function" } ], - "transactionHash": "0x49cbb4e81022fd5c76396c5809c33f609fc09e783f710d805ded1dac3b99e711", + "transactionHash": "0x3b1f865e1497c403efcb1c34f9c1c3f5523a6a641fb76eace75d124cb386ae98", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 2, - "gasUsed": "1472737", + "gasUsed": "1473171", "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000004000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000080000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100040000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xa12033c5487d8478d186740127abc006b5889d1be661867b4155dc2423ea93d2", - "transactionHash": "0x49cbb4e81022fd5c76396c5809c33f609fc09e783f710d805ded1dac3b99e711", + "blockHash": "0x389b5be51916e8c4ec07c41b846342f5f422a871acdab92e4e1b38843405e3fc", + "transactionHash": "0x3b1f865e1497c403efcb1c34f9c1c3f5523a6a641fb76eace75d124cb386ae98", "logs": [ { "transactionIndex": 2, - "blockNumber": 33191560, - "transactionHash": "0x49cbb4e81022fd5c76396c5809c33f609fc09e783f710d805ded1dac3b99e711", + "blockNumber": 43292197, + "transactionHash": "0x3b1f865e1497c403efcb1c34f9c1c3f5523a6a641fb76eace75d124cb386ae98", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", @@ -372,19 +372,19 @@ "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", "0x000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f" ], - "data": "0x0000000000000000000000000000000000000000000000000007d92b74afc7e100000000000000000000000000000000000000000000000002760a2aec4ba2a7000000000000000000000000000000000000000000002ed1895f8b4c940d1c33000000000000000000000000000000000000000000000000026e30ff779bdac6000000000000000000000000000000000000000000002ed18967647808bce414", - "logIndex": 6, - "blockHash": "0xa12033c5487d8478d186740127abc006b5889d1be661867b4155dc2423ea93d2" + "data": "0x0000000000000000000000000000000000000000000000000008a2bcee6ec41300000000000000000000000000000000000000000000000006e675e5389e70e400000000000000000000000000000000000000000000356df3b439c018ad407f00000000000000000000000000000000000000000000000006ddd3284a2facd100000000000000000000000000000000000000000000356df3bcdc7d071c0492", + "logIndex": 11, + "blockHash": "0x389b5be51916e8c4ec07c41b846342f5f422a871acdab92e4e1b38843405e3fc" } ], - "blockNumber": 33191560, - "cumulativeGasUsed": "1750412", + "blockNumber": 43292197, + "cumulativeGasUsed": "2376264", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/polygon-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/polygon-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/polygon-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/polygon-zkevm-goerli-testnet/AccessControlRegistry.json b/deployments/polygon-zkevm-goerli-testnet/AccessControlRegistry.json index cd134bbc..e5373655 100644 --- a/deployments/polygon-zkevm-goerli-testnet/AccessControlRegistry.json +++ b/deployments/polygon-zkevm-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x3e0c1e53e791eda028de068ecd3ea13600830378679e0f447e3497557e6bfc6e", + "transactionHash": "0x2c91c459e83c8bc67131f2d5cb9ed10b976be86b2b84705a106103e62f2fe85f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1720828", + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x10ecd8e117eebd3a367159fb011fec10c6e7b71310f825ca13dcefd22a3c6378", - "transactionHash": "0x3e0c1e53e791eda028de068ecd3ea13600830378679e0f447e3497557e6bfc6e", + "blockHash": "0x409d4b9319803c73eaf138a3d19c83c37976300a8d8b902f71c59203a6f16e33", + "transactionHash": "0x2c91c459e83c8bc67131f2d5cb9ed10b976be86b2b84705a106103e62f2fe85f", "logs": [], - "blockNumber": 147619, - "cumulativeGasUsed": "1720828", + "blockNumber": 3391430, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/polygon-zkevm-goerli-testnet/Api3ServerV1.json b/deployments/polygon-zkevm-goerli-testnet/Api3ServerV1.json index ceab3f28..cd041da9 100644 --- a/deployments/polygon-zkevm-goerli-testnet/Api3ServerV1.json +++ b/deployments/polygon-zkevm-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0xd9a37b5a576c0c9117fd50792f23e83089a2ca87933b32313df8f38b94246a13", + "transactionHash": "0x5be8c86fd75906f0360989084a59578fdca396db7d40e6b598d6b4fa6cfdc841", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x42669089471b73dbc7637cb4926e2dade6acc5dec1558f87361ca3462dbc4e8d", - "transactionHash": "0xd9a37b5a576c0c9117fd50792f23e83089a2ca87933b32313df8f38b94246a13", + "blockHash": "0x04c98aef48141248346302c5afedb97e91c2769f0a5fad002a5eead9433f9460", + "transactionHash": "0x5be8c86fd75906f0360989084a59578fdca396db7d40e6b598d6b4fa6cfdc841", "logs": [], - "blockNumber": 147622, + "blockNumber": 3391432, "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/polygon-zkevm-goerli-testnet/ProxyFactory.json b/deployments/polygon-zkevm-goerli-testnet/ProxyFactory.json index 73e986b0..ecf27c0f 100644 --- a/deployments/polygon-zkevm-goerli-testnet/ProxyFactory.json +++ b/deployments/polygon-zkevm-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x503d05f52990331f2d37d99a91c771268d12b794d99ad4a088f2dcf12cf75cc4", + "transactionHash": "0x6b2d992f9a37b5e32d20a7c1bc450bcd34ebb12c31e3cb6085a0f712edc5ba8b", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7e46940f9d68f00cbceba960e9a2457044e6613b6f5b1e977afbf7026357c03c", - "transactionHash": "0x503d05f52990331f2d37d99a91c771268d12b794d99ad4a088f2dcf12cf75cc4", + "blockHash": "0x749b27af1c2e4097d6456ae36e1de88533e9382106a1822499a031fd33b60be2", + "transactionHash": "0x6b2d992f9a37b5e32d20a7c1bc450bcd34ebb12c31e3cb6085a0f712edc5ba8b", "logs": [], - "blockNumber": 147624, + "blockNumber": 3391434, "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/polygon-zkevm-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/polygon-zkevm-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/polygon-zkevm-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/polygon-zkevm/AccessControlRegistry.json b/deployments/polygon-zkevm/AccessControlRegistry.json index 32f3e061..26d2fc78 100644 --- a/deployments/polygon-zkevm/AccessControlRegistry.json +++ b/deployments/polygon-zkevm/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0x0499abde3ba6e509594752ced8193d680920369d3af81e63e31b8473ad824f0c", + "transactionHash": "0xb190b23b06e6d0becce70cab952b473714c478a05d080a047440e7a8a127c56f", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "1720828", + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x649afe0824c43b6caf903e61323595ea1cf2316c191dd345a1e8bd8817ec8629", - "transactionHash": "0x0499abde3ba6e509594752ced8193d680920369d3af81e63e31b8473ad824f0c", + "blockHash": "0xb0856d0649f847d6af9362720f4ea24ff19d2740351cb6e768db3d93c57de7e9", + "transactionHash": "0xb190b23b06e6d0becce70cab952b473714c478a05d080a047440e7a8a127c56f", "logs": [], - "blockNumber": 313, - "cumulativeGasUsed": "1720828", + "blockNumber": 8431018, + "cumulativeGasUsed": "1061718", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/polygon-zkevm/Api3ServerV1.json b/deployments/polygon-zkevm/Api3ServerV1.json index 0f0d01dd..e809f56e 100644 --- a/deployments/polygon-zkevm/Api3ServerV1.json +++ b/deployments/polygon-zkevm/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0x5bfd603799f315fd36976457054389fba02d24863e27ffe84e5fb04201827ad9", + "transactionHash": "0x7b51607a7b09bf2354cae5b88fb886726e7bf583d1b01caafe2b9dff9a12ef16", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x70b1804b3d32fb65aa408931efbb8dccdff7c60c3be5170be80c14753ef1512a", - "transactionHash": "0x5bfd603799f315fd36976457054389fba02d24863e27ffe84e5fb04201827ad9", + "blockHash": "0xdb35b6dcd9aa414dae5895a3e5a1d79a734261f76dbc20c4c3e4e0538cd15585", + "transactionHash": "0x7b51607a7b09bf2354cae5b88fb886726e7bf583d1b01caafe2b9dff9a12ef16", "logs": [], - "blockNumber": 336, + "blockNumber": 8431019, "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/polygon-zkevm/OrderPayable.json b/deployments/polygon-zkevm/OrderPayable.json index 642bdc95..674484be 100644 --- a/deployments/polygon-zkevm/OrderPayable.json +++ b/deployments/polygon-zkevm/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,7 +277,7 @@ "type": "function" } ], - "transactionHash": "0xa63a67ff0caec99946cba0634b7969dcbc7450168cd2a71f8c870649e6c71c5c", + "transactionHash": "0xc2d4b888ece2167c914172c881aa813ac21da793f95d1bded88f6fcddea392d2", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -285,24 +285,24 @@ "transactionIndex": 0, "gasUsed": "1234983", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9e929363e8c3bc80999c6c24a4c7ad9d4fb489e29e455542a2be04d4ede2ee61", - "transactionHash": "0xa63a67ff0caec99946cba0634b7969dcbc7450168cd2a71f8c870649e6c71c5c", + "blockHash": "0x5d142273b267e94b645253996c7859cf98a1547f25f7d7faac20ffb7c39acd3f", + "transactionHash": "0xc2d4b888ece2167c914172c881aa813ac21da793f95d1bded88f6fcddea392d2", "logs": [], - "blockNumber": 407886, + "blockNumber": 8448066, "cumulativeGasUsed": "1234983", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/polygon-zkevm/ProxyFactory.json b/deployments/polygon-zkevm/ProxyFactory.json index d8315281..7af1447f 100644 --- a/deployments/polygon-zkevm/ProxyFactory.json +++ b/deployments/polygon-zkevm/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0xeda13eba56711c9115440e8b88c7d4b4506836eb507eb70f6f55de60f7fd7e82", + "transactionHash": "0x92697e1fd48f784f1b156783ad86272b513a02c28c85caaf0b31b73063a1497e", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xdae9df82e202c49bb2a3bc692c41de9b0a1d73aa10cc435fc9dd0e3af7a3bc01", - "transactionHash": "0xeda13eba56711c9115440e8b88c7d4b4506836eb507eb70f6f55de60f7fd7e82", + "blockHash": "0x8316b76672f5b162c62ec53be60bf2830f1874f468450657eb5eb27a24f087fd", + "transactionHash": "0x92697e1fd48f784f1b156783ad86272b513a02c28c85caaf0b31b73063a1497e", "logs": [], - "blockNumber": 337, + "blockNumber": 8431020, "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/polygon-zkevm/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/polygon-zkevm/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/polygon-zkevm/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/polygon/AccessControlRegistry.json b/deployments/polygon/AccessControlRegistry.json index f0b580fd..a4cd4ebf 100644 --- a/deployments/polygon/AccessControlRegistry.json +++ b/deployments/polygon/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,69 +342,48 @@ "type": "function" } ], - "args": [], - "transactionHash": "0x1cfce02c3c113a28c8a8735642ef36b595ceb6a4c6c6e171c3863969dd56465d", + "transactionHash": "0xb2abfc361456f9c4790c9fb003cce0445e87fa99c321bdb2281f767d41c39dcc", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 94, - "gasUsed": { "type": "BigNumber", "hex": "0x1a41fc" }, - "logsBloom": "0x00000080000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000010200000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000002000000000000000000000000100000", - "blockHash": "0xac5a0ce82b7e99fe73749b3648b5a3b2e62dbac627040f07b49a7c200fb022a3", - "transactionHash": "0x1cfce02c3c113a28c8a8735642ef36b595ceb6a4c6c6e171c3863969dd56465d", + "transactionIndex": 89, + "gasUsed": "1062014", + "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000040000000040000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x030d59dcf62c78b36286b83f910ab0feda5de19b0498f12b3d3ac1e25bb7a0e0", + "transactionHash": "0xb2abfc361456f9c4790c9fb003cce0445e87fa99c321bdb2281f767d41c39dcc", "logs": [ { - "transactionIndex": 94, - "blockNumber": 40421502, - "transactionHash": "0x1cfce02c3c113a28c8a8735642ef36b595ceb6a4c6c6e171c3863969dd56465d", + "transactionIndex": 89, + "blockNumber": 50813948, + "transactionHash": "0xb2abfc361456f9c4790c9fb003cce0445e87fa99c321bdb2281f767d41c39dcc", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x000000000000000000000000ef46d5fe753c988606e6f703260d816af53b03eb" + "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" ], - "data": "0x0000000000000000000000000000000000000000000000000017d90318701ea40000000000000000000000000000000000000000000000cd2651a2e25cdc4b6e0000000000000000000000000000000000000000000006e980e7921c0383e8500000000000000000000000000000000000000000000000cd2639c9df446c2cca0000000000000000000000000000000000000000000006e980ff6b1f1bf406f4", - "logIndex": 2356, - "blockHash": "0xac5a0ce82b7e99fe73749b3648b5a3b2e62dbac627040f07b49a7c200fb022a3" + "data": "0x000000000000000000000000000000000000000000000000007f046e907470600000000000000000000000000000000000000000000000c631bc29bff2587c2d0000000000000000000000000000000000000000000004105879eecac85045b80000000000000000000000000000000000000000000000c6313d255161e40bcd00000000000000000000000000000000000000000000041058f8f33958c4b618", + "logIndex": 249, + "blockHash": "0x030d59dcf62c78b36286b83f910ab0feda5de19b0498f12b3d3ac1e25bb7a0e0" } ], - "blockNumber": 40421502, - "confirmations": 406901, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x0137a509" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0e73fdd2ad" }, + "blockNumber": 50813948, + "cumulativeGasUsed": "8621599", "status": 1, - "type": 2, "byzantium": true }, + "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -617,21 +446,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -654,14 +474,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -687,13 +499,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/polygon/Api3ServerV1.json b/deployments/polygon/Api3ServerV1.json index 678a679e..6b9061fb 100644 --- a/deployments/polygon/Api3ServerV1.json +++ b/deployments/polygon/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,51 +741,19 @@ "type": "function" } ], - "transactionHash": "0x077decd3f0af642a67fb2098ddfe4350c229f6bf8504b3b30c5683386d18f9f6", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 139, - "gasUsed": { "type": "BigNumber", "hex": "0x2d2d74" }, - "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100010000000000000000000000000000000000080000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x899cf2f23f6cbb6bf5cc81ceb28e12ba6fa9cf28ab22d6e9643791ef4d946299", - "transactionHash": "0x077decd3f0af642a67fb2098ddfe4350c229f6bf8504b3b30c5683386d18f9f6", - "logs": [ - { - "transactionIndex": 139, - "blockNumber": 40421857, - "transactionHash": "0x077decd3f0af642a67fb2098ddfe4350c229f6bf8504b3b30c5683386d18f9f6", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x00000000000000000000000060e274b09f701107a4b3226fcc1376ebda3cdd92" - ], - "data": "0x000000000000000000000000000000000000000000000000014fc46fb2fc804c0000000000000000000000000000000000000000000000cd24663ad9966cb04e000000000000000000000000000000000000000000000f6204f2fa28a10154870000000000000000000000000000000000000000000000cd23167669e3703002000000000000000000000000000000000000000000000f620642be9853fdd4d3", - "logIndex": 547, - "blockHash": "0x899cf2f23f6cbb6bf5cc81ceb28e12ba6fa9cf28ab22d6e9643791ef4d946299" - } - ], - "blockNumber": 40421857, - "confirmations": 406563, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x01a2a7bf" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x104c533c00" }, - "status": 1, - "type": 0, - "byzantium": true + "blockNumber": 50814053 }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1029,7 +997,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1037,23 +1005,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1061,7 +1029,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1085,12 +1053,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1106,24 +1074,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1131,7 +1099,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/polygon/OrderPayable.json b/deployments/polygon/OrderPayable.json index 92fa4f29..925a1777 100644 --- a/deployments/polygon/OrderPayable.json +++ b/deployments/polygon/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,48 +277,48 @@ "type": "function" } ], - "transactionHash": "0xf1dcb51c222ec5321a8ed44f5d05a4c9649390fe9579f1f11365b9941474b081", + "transactionHash": "0xb8f74c513263adebaca6060c37ee13c006279b97bf4e1336961db476905d52cd", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 34, - "gasUsed": "1234983", - "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100020000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000020100000", - "blockHash": "0xdf306fc6af511a2c280b7e0aa9518e8d5354b2c4acd80e6a4ca184f1250eb5e8", - "transactionHash": "0xf1dcb51c222ec5321a8ed44f5d05a4c9649390fe9579f1f11365b9941474b081", + "transactionIndex": 74, + "gasUsed": "1235415", + "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000000000000000000000000000080000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000080000200000000000000000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x8af2705898d2ef371d3631e4243a13918c692f37c2a769f05a9dc8f8f49f2626", + "transactionHash": "0xb8f74c513263adebaca6060c37ee13c006279b97bf4e1336961db476905d52cd", "logs": [ { - "transactionIndex": 34, - "blockNumber": 43125869, - "transactionHash": "0xf1dcb51c222ec5321a8ed44f5d05a4c9649390fe9579f1f11365b9941474b081", + "transactionIndex": 74, + "blockNumber": 50855002, + "transactionHash": "0xb8f74c513263adebaca6060c37ee13c006279b97bf4e1336961db476905d52cd", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x000000000000000000000000794e44d1334a56fea7f4df12633b88820d0c5888" + "0x000000000000000000000000f0245f6251bef9447a08766b9da2b07b28ad80b0" ], - "data": "0x00000000000000000000000000000000000000000000000000bbf189b13e6f600000000000000000000000000000000000000000000000cccfbbb6fdbd06e8930000000000000000000000000000000000000000000002ade2a44f3fc56073e30000000000000000000000000000000000000000000000ccceffc5740bc879330000000000000000000000000000000000000000000002ade36040c9769ee343", - "logIndex": 158, - "blockHash": "0xdf306fc6af511a2c280b7e0aa9518e8d5354b2c4acd80e6a4ca184f1250eb5e8" + "data": "0x00000000000000000000000000000000000000000000000000ca3d06ef758f1b0000000000000000000000000000000000000000000000c6203df99f157b7ad30000000000000000000000000000000000000000000002789c9d5328e18c33d20000000000000000000000000000000000000000000000c61f73bc982605ebb80000000000000000000000000000000000000000000002789d67902fd101c2ed", + "logIndex": 187, + "blockHash": "0x8af2705898d2ef371d3631e4243a13918c692f37c2a769f05a9dc8f8f49f2626" } ], - "blockNumber": 43125869, - "cumulativeGasUsed": "8569345", + "blockNumber": 50855002, + "cumulativeGasUsed": "7446293", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "7b3ef0c12daee397e3302a6b87af04a0", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -413,7 +413,7 @@ "storageLayout": { "storage": [ { - "astId": 6427, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -421,7 +421,7 @@ "type": "t_string_storage" }, { - "astId": 17707, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/polygon/ProxyFactory.json b/deployments/polygon/ProxyFactory.json index 27c90bbc..2d06050f 100644 --- a/deployments/polygon/ProxyFactory.json +++ b/deployments/polygon/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,41 +350,41 @@ "type": "function" } ], - "transactionHash": "0x1ac0356f5e017567134710be561ae6acfcb8a9d7cbfa78ecf6102eed7118f9b9", + "transactionHash": "0xfb690f43594de44fef9ec204d98752a99f7ef3f707f8a76ca8206c9fb713c488", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 25, - "gasUsed": "1472737", - "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000040000100000000000000000020000000000000000000010000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x70f009dd1431535ef383ef767170c3ef84006b8667d69153098355d55eff5101", - "transactionHash": "0x1ac0356f5e017567134710be561ae6acfcb8a9d7cbfa78ecf6102eed7118f9b9", + "transactionIndex": 40, + "gasUsed": "1473171", + "logsBloom": "0x00000080000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000008000000000000000000000000000200000000000000000000000000000020000000000000000000010000000004000000000000000000081000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x9260bc58b21d9ee8730bb9775ff262443ac0a88e96bb25819f00885e8f751ae8", + "transactionHash": "0xfb690f43594de44fef9ec204d98752a99f7ef3f707f8a76ca8206c9fb713c488", "logs": [ { - "transactionIndex": 25, - "blockNumber": 40421901, - "transactionHash": "0x1ac0356f5e017567134710be561ae6acfcb8a9d7cbfa78ecf6102eed7118f9b9", + "transactionIndex": 40, + "blockNumber": 50814057, + "transactionHash": "0xfb690f43594de44fef9ec204d98752a99f7ef3f707f8a76ca8206c9fb713c488", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x00000000000000000000000026c80cc193b27d73d2c40943acec77f4da2c5bd8" + "0x000000000000000000000000e7e2cb8c81c10ff191a73fe266788c9ce62ec754" ], - "data": "0x00000000000000000000000000000000000000000000000000f9e1f84a04f4020000000000000000000000000000000000000000000000cd2185eb6ad329804e00000000000000000000000000000000000000000000108ef2160a628b20b0530000000000000000000000000000000000000000000000cd208c097289248c4c00000000000000000000000000000000000000000000108ef30fec5ad525a455", - "logIndex": 106, - "blockHash": "0x70f009dd1431535ef383ef767170c3ef84006b8667d69153098355d55eff5101" + "data": "0x00000000000000000000000000000000000000000000000000d9b91a00bf18620000000000000000000000000000000000000000000000c62830745d2eb0c091000000000000000000000000000000000000000000005194da23a676a87f49db0000000000000000000000000000000000000000000000c62756bb432df1a82f000000000000000000000000000000000000000000005194dafd5f90a93e623d", + "logIndex": 129, + "blockHash": "0x9260bc58b21d9ee8730bb9775ff262443ac0a88e96bb25819f00885e8f751ae8" } ], - "blockNumber": 40421901, - "cumulativeGasUsed": "6023785", + "blockNumber": 50814057, + "cumulativeGasUsed": "5636085", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/polygon/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/polygon/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/polygon/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/references.json b/deployments/references.json index fc04040f..5fd1e03f 100644 --- a/deployments/references.json +++ b/deployments/references.json @@ -10,18 +10,13 @@ "100": "gnosis", "137": "polygon", "250": "fantom", - "280": "zksync-goerli-testnet", - "324": "zksync", "338": "cronos-testnet", "420": "optimism-goerli-testnet", - "599": "metis-goerli-testnet", - "1088": "metis", "1101": "polygon-zkevm", "1284": "moonbeam", "1285": "moonriver", "1287": "moonbeam-testnet", "1442": "polygon-zkevm-goerli-testnet", - "2001": "milkomeda-c1", "2221": "kava-testnet", "2222": "kava", "4002": "fantom-testnet", @@ -36,52 +31,45 @@ "59144": "linea", "80001": "polygon-testnet", "84531": "base-goerli-testnet", - "200101": "milkomeda-c1-testnet", "421613": "arbitrum-goerli-testnet", "534353": "scroll-goerli-testnet", "11155111": "ethereum-sepolia-testnet" }, "AccessControlRegistry": { - "1": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "5": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "10": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "30": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "31": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "56": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "97": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "100": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "137": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "250": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "280": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "324": "0x0c150b404A639E603639b575B101B38B64e12D0b", - "338": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", - "420": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "599": "0x8262a9DAB3f8a0b1E6317551E214CeA89Bc3f56d", - "1088": "0x824cb5cE2894cBA4eDdd005c5029eD17F5FEcf99", - "1101": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "1284": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "1285": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "1287": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "1442": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "2001": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "2221": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "2222": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "4002": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "5000": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "5001": "0x55Cf1079a115029a879ec3A11Ba5D453272eb61D", - "8453": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "10200": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "42161": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "43113": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "43114": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "59140": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "59144": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "80001": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "84531": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "200101": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "421613": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "534353": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", - "11155111": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834" + "1": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "5": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "10": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "30": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "31": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "56": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "97": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "100": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "137": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "250": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "338": "0x8984152339F9D35742BB878D0eaD9EF9fd6469d3", + "420": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "1101": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "1284": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "1285": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "1287": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "1442": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "2221": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "2222": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "4002": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "5000": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "5001": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "8453": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "10200": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "42161": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "43113": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "43114": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "59140": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "59144": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "80001": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "84531": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "421613": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "534353": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "11155111": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730" }, "OwnableCallForwarder": { "1": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", @@ -94,23 +82,18 @@ "100": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "137": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "250": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "280": "0xD6A26d7612c2781b380e13Cf542d846F9A360BD7", - "324": "0x1e0cd5CDB3a7bc2Db750aBc12FeeD05CA94e90ab", "338": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", "420": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "599": "0xC02Ea0f403d5f3D45a4F1d0d817e7A2601346c9E", - "1088": "0x2D6D050Fc44d4db1c8577f4cF87905811fA126b2", "1101": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "1284": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "1285": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "1287": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "1442": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "2001": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "2221": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "2222": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "4002": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "5000": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "5001": "0x1DCE40DC2AfA7131C4838c8BFf635ae9d198d1cE", + "5001": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "8453": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "10200": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "42161": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", @@ -120,127 +103,99 @@ "59144": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "80001": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "84531": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", - "200101": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "421613": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "534353": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "11155111": "0x81bc85f329cDB28936FbB239f734AE495121F9A6" }, "Api3ServerV1": { - "1": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "5": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "10": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "30": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "31": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "56": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "97": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "100": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "137": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "250": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "280": "0x9104356BB320Ab72FffbDCfe979577fc78377821", - "324": "0xAC26e0F627569c04DAe1B1E039B62bb5d6760Fe8", - "338": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", - "420": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "599": "0xDDe9CE3736939d59A70c446c8A4AB6714CB4a41a", - "1088": "0x784b1ce3fa1e60Bc1cf924711f0D5AA484C9b37e", - "1101": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "1284": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "1285": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "1287": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "1442": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "2001": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "2221": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "2222": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "4002": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "5000": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "5001": "0x2b4401E59780e44d3b1Fd2D41FCb3047c830F286", - "8453": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "10200": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "42161": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "43113": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "43114": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "59140": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "59144": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "80001": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "84531": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "200101": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "421613": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "534353": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", - "11155111": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76" + "1": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "5": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "10": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "30": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "31": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "56": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "97": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "100": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "137": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "250": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "338": "0x33E6C2f5Fa6aA18254927F55b0C5b5B975Ec1358", + "420": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "1101": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "1284": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "1285": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "1287": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "1442": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "2221": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "2222": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "4002": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "5000": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "5001": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "8453": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "10200": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "42161": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "43113": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "43114": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "59140": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "59144": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "80001": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "84531": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "421613": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "534353": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "11155111": "0x709944a48cAf83535e43471680fDA4905FB3920a" }, "ProxyFactory": { - "1": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "5": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "10": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "30": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "31": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "56": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "97": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "100": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "137": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "250": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "280": "0xb9ed9a0Ecfcc544D8eB82BeeBE79B03e13012d7c", - "324": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "338": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", - "420": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "599": "0x3d0Ca9e5490E36627beA9a8cb3cefa12D7cDc0af", - "1088": "0xd9b82260eaaa2CDe8150474C94C130ca681bB127", - "1101": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "1284": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "1285": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "1287": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "1442": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "2001": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "2221": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "2222": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "4002": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "5000": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "5001": "0x5aB00E30453EEAd35025A761ED65d51d74574C24", - "8453": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "10200": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "42161": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "43113": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "43114": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "59140": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "59144": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "80001": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "84531": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "200101": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "421613": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "534353": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", - "11155111": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD" - }, - "MockErc20PermitToken": { - "5": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9", - "80001": "0x2393F30d46a82D3F2A6339c249fB894fe8A2daD9" - }, - "PrepaymentDepository": { - "1": "0x8367a2a08e46e0BA57CF1a24412E5AF7b4236D93", - "5": "0x7A175B0C798bDD6C0Ea10C9d82dcd40a05e0F672", - "80001": "0x7A175B0C798bDD6C0Ea10C9d82dcd40a05e0F672" + "1": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "5": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "10": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "30": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "31": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "56": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "97": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "100": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "137": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "250": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "338": "0xC3E76D8829259f2A34541746de2F8A0509Dc1987", + "420": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "1101": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "1284": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "1285": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "1287": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "1442": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "2221": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "2222": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "4002": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "5000": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "5001": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "8453": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "10200": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "42161": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "43113": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "43114": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "59140": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "59144": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "80001": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "84531": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "421613": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "534353": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "11155111": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD" }, "OrderPayable": { - "1": "0x045808285C69014Beb9f70447155A4c55376fc06", - "5": "0x045808285C69014Beb9f70447155A4c55376fc06", - "10": "0x045808285C69014Beb9f70447155A4c55376fc06", - "30": "0x045808285C69014Beb9f70447155A4c55376fc06", - "56": "0x045808285C69014Beb9f70447155A4c55376fc06", - "100": "0x045808285C69014Beb9f70447155A4c55376fc06", - "137": "0x045808285C69014Beb9f70447155A4c55376fc06", - "250": "0x045808285C69014Beb9f70447155A4c55376fc06", - "1101": "0x045808285C69014Beb9f70447155A4c55376fc06", - "1284": "0x045808285C69014Beb9f70447155A4c55376fc06", - "1285": "0x045808285C69014Beb9f70447155A4c55376fc06", - "2222": "0x045808285C69014Beb9f70447155A4c55376fc06", - "5000": "0x045808285C69014Beb9f70447155A4c55376fc06", - "8453": "0x045808285C69014Beb9f70447155A4c55376fc06", - "42161": "0x045808285C69014Beb9f70447155A4c55376fc06", - "43114": "0x045808285C69014Beb9f70447155A4c55376fc06", - "59144": "0x045808285C69014Beb9f70447155A4c55376fc06", - "11155111": "0x045808285C69014Beb9f70447155A4c55376fc06" + "1": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "10": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "30": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "56": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "100": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "137": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "250": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "1101": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "1284": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "1285": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "2222": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "5000": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "8453": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "42161": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "43114": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "59144": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C" }, - "RequesterAuthorizerWithErc721": { - "1": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2", - "5": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2", - "11155111": "0x5f2c88ba533DbA48d570b9bad5Ee6Be1A719FcA2" - } + "RequesterAuthorizerWithErc721": {} } diff --git a/deployments/rsk-testnet/AccessControlRegistry.json b/deployments/rsk-testnet/AccessControlRegistry.json index b9f59684..ad397285 100644 --- a/deployments/rsk-testnet/AccessControlRegistry.json +++ b/deployments/rsk-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,52 +342,32 @@ "type": "function" } ], - "transactionHash": "0x8ed5aa13bfb14e185e125a3674eb36e070430eac4185d6b45095713239ab7cb8", + "transactionHash": "0xa3319d38487ca31508c7e4136d6b72032a09ad6bb86062e0730336b6cd453718", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": { "type": "BigNumber", "hex": "0x1ffc58" }, + "gasUsed": "1285682", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xab00f5b085b688a7fd0ec7d3675d9f4e7103cd93b51c19b12446e7370cb3ead2", - "transactionHash": "0x8ed5aa13bfb14e185e125a3674eb36e070430eac4185d6b45095713239ab7cb8", + "blockHash": "0x1fda954d9d11df5c0ac8a989a5cb29c73b291310c536f5814d720cd048ca7bf2", + "transactionHash": "0xa3319d38487ca31508c7e4136d6b72032a09ad6bb86062e0730336b6cd453718", "logs": [], - "blockNumber": 3658426, - "confirmations": 39770, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x1ffc58" }, + "blockNumber": 4570400, + "cumulativeGasUsed": "1285682", "status": 1, - "type": 0, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -600,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -637,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -670,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/rsk-testnet/Api3ServerV1.json b/deployments/rsk-testnet/Api3ServerV1.json index 19c432d7..825861d4 100644 --- a/deployments/rsk-testnet/Api3ServerV1.json +++ b/deployments/rsk-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,7 +741,7 @@ "type": "function" } ], - "transactionHash": "0xe04d98670856ee919d21592cadba1dd24d3c21d51a54aff55dc6db44bf1c1cc0", + "transactionHash": "0xab09da9365457ed67254c2ecdce697f6320de2a46d304e984aff469344269a36", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -749,24 +749,24 @@ "transactionIndex": 0, "gasUsed": "3676560", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0a6181ead6ac35adae3e74d4f942c406c5b36f8c96c22bc105dde619e7adab23", - "transactionHash": "0xe04d98670856ee919d21592cadba1dd24d3c21d51a54aff55dc6db44bf1c1cc0", + "blockHash": "0xac6beeb57aa6ac1743c447168905af476208ac7c194b76a24c59f5e8b225d329", + "transactionHash": "0xab09da9365457ed67254c2ecdce697f6320de2a46d304e984aff469344269a36", "logs": [], - "blockNumber": 3664679, + "blockNumber": 4570402, "cumulativeGasUsed": "3676560", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/rsk-testnet/ProxyFactory.json b/deployments/rsk-testnet/ProxyFactory.json index fcadb0a6..bdac71d5 100644 --- a/deployments/rsk-testnet/ProxyFactory.json +++ b/deployments/rsk-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x7b13915f3649e1af31a763f124a86beb22b72df014e5b42c0763afc6a9063765", + "transactionHash": "0x08d31a4e4a2cd245c81363de0a4be00bc9184cd8217999ccc3d124ecdea61dce", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1767525", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x052a1dac213c763f3ea99cc7dd567e0c08d541f128754f9da6068a7762ed1ef6", - "transactionHash": "0x7b13915f3649e1af31a763f124a86beb22b72df014e5b42c0763afc6a9063765", + "blockHash": "0xe1b87546655cf0b8cc9d0269e147bf628741d2dcc43c11f05eb8ad1f600cc206", + "transactionHash": "0x08d31a4e4a2cd245c81363de0a4be00bc9184cd8217999ccc3d124ecdea61dce", "logs": [], - "blockNumber": 3664681, + "blockNumber": 4570404, "cumulativeGasUsed": "1767525", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/rsk-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/rsk-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/rsk-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/rsk/AccessControlRegistry.json b/deployments/rsk/AccessControlRegistry.json index 2283c93e..28f98d92 100644 --- a/deployments/rsk/AccessControlRegistry.json +++ b/deployments/rsk/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,50 +342,32 @@ "type": "function" } ], - "transactionHash": "0xb71e1027bc977918ad2329a4cf3c6a82124cbca9fb4a1e6b3d3bd929812e415e", + "transactionHash": "0xf2dfdef011067e2649395f4da947480c079442d97b340a390b420a99bd32b235", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, "transactionIndex": 0, - "gasUsed": "2096216", + "gasUsed": "1285682", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xce26bffcbd79076281f5a163a3dca4975f110eecdff5ff583ac8456d614ecd0a", - "transactionHash": "0xb71e1027bc977918ad2329a4cf3c6a82124cbca9fb4a1e6b3d3bd929812e415e", + "blockHash": "0x07aa2928f533bc3bc5b2326fa3f8c2f710acb42ab5a240286e1f6ab974d956ec", + "transactionHash": "0xf2dfdef011067e2649395f4da947480c079442d97b340a390b420a99bd32b235", "logs": [], - "blockNumber": 5136160, - "cumulativeGasUsed": "2096216", + "blockNumber": 5878534, + "cumulativeGasUsed": "1285682", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -598,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -635,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 11920, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -668,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/rsk/Api3ServerV1.json b/deployments/rsk/Api3ServerV1.json index f3e780a0..943ccb54 100644 --- a/deployments/rsk/Api3ServerV1.json +++ b/deployments/rsk/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,19 @@ "type": "function" } ], - "transactionHash": "0x20143fe791d39ece48252961f00287c0f3263719c9eec1ee028a1ccd0193afff", "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": null, - "transactionIndex": 0, - "gasUsed": "3676560", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf82b899f6098a3ddae0769890c3661605c446bdfdf460228266df6b45dfb7531", - "transactionHash": "0x20143fe791d39ece48252961f00287c0f3263719c9eec1ee028a1ccd0193afff", - "logs": [], - "blockNumber": 5136190, - "cumulativeGasUsed": "3676560", - "status": 1, - "byzantium": true + "blockNumber": 5878540 }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +997,7 @@ "storageLayout": { "storage": [ { - "astId": 2826, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1005,23 @@ "type": "t_string_storage" }, { - "astId": 4153, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 4642, + "astId": 8023, "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)4147_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 4648, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1029,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3975, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1053,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4147_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1074,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)4147_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)4147_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)4147_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 4144, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1099,7 @@ "type": "t_int224" }, { - "astId": 4146, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/rsk/OrderPayable.json b/deployments/rsk/OrderPayable.json index b3c1c890..4e8291a1 100644 --- a/deployments/rsk/OrderPayable.json +++ b/deployments/rsk/OrderPayable.json @@ -1,5 +1,5 @@ { - "address": "0x045808285C69014Beb9f70447155A4c55376fc06", + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "abi": [ { "inputs": [ @@ -277,7 +277,7 @@ "type": "function" } ], - "transactionHash": "0x91fcae8cbbe8eeb9a6e9a0500a3f6d99d6e19e8bffb3072b8fdd216d4e2a5148", + "transactionHash": "0xcdd1e0f5023d871ea781752ff73d07a6be61c2fd81a474b62b87b2127fe34ceb", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -285,24 +285,24 @@ "transactionIndex": 0, "gasUsed": "1543763", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xba2e72a8d403c2fec4d32f840a8390a3d1b2afc15e68b154eb1e776ca3371098", - "transactionHash": "0x91fcae8cbbe8eeb9a6e9a0500a3f6d99d6e19e8bffb3072b8fdd216d4e2a5148", + "blockHash": "0xfc3b2c457ad0451eb77248e30a3634909d02d06b324a7c513f87250fcbd9f380", + "transactionHash": "0xcdd1e0f5023d871ea781752ff73d07a6be61c2fd81a474b62b87b2127fe34ceb", "logs": [], - "blockNumber": 5637195, + "blockNumber": 5878838, "cumulativeGasUsed": "1543763", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "OrderPayable admin (API3 Market)", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220b3199208d7354710eefbda29ef8ddce5e6645e9390e08fb915980ff9fd4b554c64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -397,7 +397,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "adminRoleDescription", "offset": 0, @@ -405,7 +405,7 @@ "type": "t_string_storage" }, { - "astId": 17535, + "astId": 17487, "contract": "contracts/utils/OrderPayable.sol:OrderPayable", "label": "orderIdToPaymentStatus", "offset": 0, diff --git a/deployments/rsk/ProxyFactory.json b/deployments/rsk/ProxyFactory.json index 3b4f154c..c03e04b0 100644 --- a/deployments/rsk/ProxyFactory.json +++ b/deployments/rsk/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,7 +350,7 @@ "type": "function" } ], - "transactionHash": "0x903b161ef752ed600ef06d5569f703f3bafb1edcc4d195b5da5fa6dc0032484e", + "transactionHash": "0x31218c31dc295db49419377c7b15912856a885cd77f48554073b353ec4ef423b", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", @@ -358,17 +358,17 @@ "transactionIndex": 0, "gasUsed": "1767525", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7265fb6c888938af10dbee8368f2b1d0ba46a4fcd6b1dc1b072da271000362ce", - "transactionHash": "0x903b161ef752ed600ef06d5569f703f3bafb1edcc4d195b5da5fa6dc0032484e", + "blockHash": "0xa403c937e9c9dad45d72e122cf7e484e9a38e684c08c3ce597cdfff1962950db", + "transactionHash": "0x31218c31dc295db49419377c7b15912856a885cd77f48554073b353ec4ef423b", "logs": [], - "blockNumber": 5136194, + "blockNumber": 5878561, "cumulativeGasUsed": "1767525", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "160c232ace54ed2fca767d4479ed1fc2", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/rsk/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/rsk/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/rsk/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/scroll-goerli-testnet/AccessControlRegistry.json b/deployments/scroll-goerli-testnet/AccessControlRegistry.json index bdd68737..1b22e95f 100644 --- a/deployments/scroll-goerli-testnet/AccessControlRegistry.json +++ b/deployments/scroll-goerli-testnet/AccessControlRegistry.json @@ -1,37 +1,6 @@ { - "address": "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -176,87 +145,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -355,44 +243,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -492,53 +342,32 @@ "type": "function" } ], - "transactionHash": "0x6d028fbe125c22e67606bf7a37942fae98fc68f6c99ecf6246ca148e7541c600", + "transactionHash": "0xdb43bba8913c81b4a911f432a712224a26a3829595d8543b3eb7d72ef26ba357", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 2, - "gasUsed": "1720828", + "transactionIndex": 0, + "gasUsed": "1061718", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5eebea621320df251297de98d62d38131125013a27f8ac1115c9a9930fa684f4", - "transactionHash": "0x6d028fbe125c22e67606bf7a37942fae98fc68f6c99ecf6246ca148e7541c600", + "blockHash": "0xc76c9ec0bddac9b55366aaed0899189299655ec7a206e4cc9da3618299189e63", + "transactionHash": "0xdb43bba8913c81b4a911f432a712224a26a3829595d8543b3eb7d72ef26ba357", "logs": [], - "blockNumber": 3833207, - "confirmations": 672, - "cumulativeGasUsed": "1794492", - "effectiveGasPrice": "1000000", + "blockNumber": 5856670, + "cumulativeGasUsed": "1061718", "status": 1, - "type": 0, "byzantium": true }, "args": [], - "numDeployments": 3, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"CanceledMetaTx\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"metaTxHash\",\"type\":\"bytes32\"}],\"name\":\"ExecutedMetaTx\",\"type\":\"event\"},{\"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\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"}],\"name\":\"cancel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"}],\"internalType\":\"struct IExpiringMetaTxForwarder.ExpiringMetaTx\",\"name\":\"metaTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returndata\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"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\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"metaTxWithHashIsExecutedOrCanceled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"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\":\"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\":{\"cancel((address,address,bytes,uint256))\":{\"details\":\"This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability\",\"params\":{\"metaTx\":\"Meta-tx\"}},\"constructor\":{\"details\":\"AccessControlRegistry is its own trusted meta-tx forwarder\"},\"execute((address,address,bytes,uint256),bytes)\":{\"params\":{\"metaTx\":\"Meta-tx\",\"signature\":\"Meta-tx hash signed by `from`\"},\"returns\":{\"returndata\":\"Returndata\"}},\"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\":{\"cancel((address,address,bytes,uint256))\":{\"notice\":\"Called by a meta-tx source to prevent it from being executed\"},\"execute((address,address,bytes,uint256),bytes)\":{\"notice\":\"Verifies the signature and executes the meta-tx\"},\"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\"},\"metaTxWithHashIsExecutedOrCanceled(bytes32)\":{\"notice\":\"If the meta-tx with hash is executed or canceled\"},\"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/metatx/ERC2771Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\\n\\npragma solidity ^0.8.9;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Context variant with ERC2771 support.\\n */\\nabstract contract ERC2771Context is Context {\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address private immutable _trustedForwarder;\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address trustedForwarder) {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n function _msgSender() internal view virtual override returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n /// @solidity memory-safe-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return super._msgSender();\\n }\\n }\\n\\n function _msgData() internal view virtual override returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return super._msgData();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb6a3e264c7fc4ec11d244561232b0f49dbccc75ce3d14e5f0181cf134fa6db29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/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/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSA.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n */\\nabstract contract EIP712 {\\n /* solhint-disable var-name-mixedcase */\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n\\n bytes32 private immutable _HASHED_NAME;\\n bytes32 private immutable _HASHED_VERSION;\\n bytes32 private immutable _TYPE_HASH;\\n\\n /* solhint-enable var-name-mixedcase */\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n bytes32 hashedName = keccak256(bytes(name));\\n bytes32 hashedVersion = keccak256(bytes(version));\\n bytes32 typeHash = keccak256(\\n \\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"\\n );\\n _HASHED_NAME = hashedName;\\n _HASHED_VERSION = hashedVersion;\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\\n _CACHED_THIS = address(this);\\n _TYPE_HASH = typeHash;\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\\n return _CACHED_DOMAIN_SEPARATOR;\\n } else {\\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\\n }\\n }\\n\\n function _buildDomainSeparator(\\n bytes32 typeHash,\\n bytes32 nameHash,\\n bytes32 versionHash\\n ) private view returns (bytes32) {\\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n}\\n\",\"keccak256\":\"0x948d8b2d18f38141ec78c5229d770d950ebc781ed3f44cc9e3ccbb9fded5846a\",\"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/metatx/ERC2771Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/ExpiringMetaTxForwarder.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 ERC2771Context,\\n AccessControl,\\n ExpiringMetaTxForwarder,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @dev AccessControlRegistry is its own trusted meta-tx forwarder\\n constructor() ERC2771Context(address(this)) {}\\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 /// @dev See Context.sol\\n function _msgSender()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (address)\\n {\\n return ERC2771Context._msgSender();\\n }\\n\\n /// @dev See Context.sol\\n function _msgData()\\n internal\\n view\\n virtual\\n override(Context, ERC2771Context)\\n returns (bytes calldata)\\n {\\n return ERC2771Context._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x28cfb80370f0c87cc165ac26f52c13956941b5d5738c38d370f3d33e82944570\",\"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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"license\":\"MIT\"},\"contracts/utils/ExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IExpiringMetaTxForwarder.sol\\\";\\n\\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\\n/// trust it\\n/// @notice `msg.value` is not supported. Identical meta-txes are not\\n/// supported. Target account must be a contract. Signer of the meta-tx is\\n/// allowed to cancel it before execution, effectively rendering the signature\\n/// useless.\\n/// This implementation is not intended to be used with general-purpose relayer\\n/// networks. Instead, it is meant for use-cases where the relayer wants the\\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\\n/// cover the gas cost.\\n/// @dev This implementation does not use signer-specific nonces for meta-txes\\n/// to be executable in an arbitrary order. For example, one can sign two\\n/// meta-txes that will whitelist an account each and deliver these to the\\n/// respective owners of the accounts. This implementation allows the account\\n/// owners to not care about if and when the other meta-tx is executed. The\\n/// signer is responsible for not issuing signatures that may cause undesired\\n/// race conditions.\\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\\n using ECDSA for bytes32;\\n using Address for address;\\n\\n /// @notice If the meta-tx with hash is executed or canceled\\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\\n /// requiring users keep track of nonces\\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\\n\\n bytes32 private constant _TYPEHASH =\\n keccak256(\\n \\\"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\\\"\\n );\\n\\n constructor() EIP712(\\\"ExpiringMetaTxForwarder\\\", \\\"1.0.0\\\") {}\\n\\n /// @notice Verifies the signature and executes the meta-tx\\n /// @param metaTx Meta-tx\\n /// @param signature Meta-tx hash signed by `from`\\n /// @return returndata Returndata\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external override returns (bytes memory returndata) {\\n bytes32 metaTxHash = processMetaTx(metaTx);\\n require(\\n metaTxHash.recover(signature) == metaTx.from,\\n \\\"Invalid signature\\\"\\n );\\n emit ExecutedMetaTx(metaTxHash);\\n returndata = metaTx.to.functionCall(\\n abi.encodePacked(metaTx.data, metaTx.from)\\n );\\n }\\n\\n /// @notice Called by a meta-tx source to prevent it from being executed\\n /// @dev This can be used to cancel meta-txes that were issued\\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\\n /// which may create a dangling liability\\n /// @param metaTx Meta-tx\\n function cancel(ExpiringMetaTx calldata metaTx) external override {\\n require(_msgSender() == metaTx.from, \\\"Sender not meta-tx source\\\");\\n emit CanceledMetaTx(processMetaTx(metaTx));\\n }\\n\\n /// @notice Checks if the meta-tx is valid, invalidates it for future\\n /// execution or nullification, and returns the meta-tx hash\\n /// @param metaTx Meta-tx\\n /// @return metaTxHash Meta-tx hash\\n function processMetaTx(\\n ExpiringMetaTx calldata metaTx\\n ) private returns (bytes32 metaTxHash) {\\n metaTxHash = _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n _TYPEHASH,\\n metaTx.from,\\n metaTx.to,\\n keccak256(metaTx.data),\\n metaTx.expirationTimestamp\\n )\\n )\\n );\\n require(\\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\\n \\\"Meta-tx executed or canceled\\\"\\n );\\n require(\\n metaTx.expirationTimestamp > block.timestamp,\\n \\\"Meta-tx expired\\\"\\n );\\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\\n }\\n}\\n\",\"keccak256\":\"0x53ab65089c6e811a66f18524512c8ea3a2ef18e94dbf36f9d0b8b088e0daff12\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x61016060405234801561001157600080fd5b50604080518082018252601781527f4578706972696e674d6574615478466f727761726465720000000000000000006020808301918252835180850190945260058452640312e302e360dc1b90840190815230608052825190912083519091206101008290526101208190524660c0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6100f48184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60a0523060e052610140525061010992505050565b60805160a05160c05160e051610100516101205161014051611e2461016a60003960006116270152600061167601526000611651015260006115aa015260006115d4015260006115fe0152600081816101cc015261136a0152611e246000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806373e9836211610097578063a217fddf11610066578063a217fddf1461026c578063ac9650d814610274578063d547741f14610294578063e83a6888146102a757600080fd5b806373e98362146101fc5780637f7120fe1461020f57806391d14854146102225780639cd98f501461025957600080fd5b806336568abe116100d357806336568abe14610168578063437b91161461017b57806353b3a0e91461019c578063572b6c05146101bc57600080fd5b806301ffc9a7146100fa578063248a9ca3146101225780632f2ff15d14610153575b600080fd5b61010d610108366004611868565b6102ca565b60405190151581526020015b60405180910390f35b6101456101303660046118aa565b60009081526020819052604090206001015490565b604051908152602001610119565b6101666101613660046118df565b610363565b005b6101666101763660046118df565b61038d565b61018e61018936600461190b565b610426565b604051610119929190611a28565b6101af6101aa366004611adb565b61058c565b6040516101199190611b44565b61010d6101ca366004611b57565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61014561020a366004611b72565b6106da565b61016661021d366004611b57565b61083f565b61010d6102303660046118df565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610166610267366004611bb1565b610952565b610145600081565b61028761028236600461190b565b6109fb565b6040516101199190611be6565b6101666102a23660046118df565b610b7c565b61010d6102b53660046118aa565b60016020526000908152604090205460ff1681565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061035d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60008281526020819052604090206001015461037e81610ba1565b6103888383610bb5565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036104185760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b6104228282610c54565b5050565b606080828067ffffffffffffffff81111561044357610443611bf9565b60405190808252806020026020018201604052801561046c578160200160208202803683370190505b5092508067ffffffffffffffff81111561048857610488611bf9565b6040519080825280602002602001820160405280156104bb57816020015b60608152602001906001900390816104a65790505b50915060005b8181101561058357308686838181106104dc576104dc611c0f565b90506020028101906104ee9190611c25565b6040516104fc929190611c6c565b600060405180830381855af49150503d8060008114610537576040519150601f19603f3d011682016040523d82523d6000602084013e61053c565b606091505b5085838151811061054f5761054f611c0f565b6020026020010185848151811061056857610568611c0f565b602090810291909101019190915290151590526001016104c1565b50509250929050565b6060600061059985610cec565b90506105a86020860186611b57565b6001600160a01b03166105f385858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050610e7b9050565b6001600160a01b0316146106495760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964207369676e6174757265000000000000000000000000000000604482015260640161040f565b60405181907f21a3ff74a15d44b8f30ad1ee0774b65b86f1bff1e29938818a5d092a7d5674d990600090a26106d16106846040870187611c25565b6106916020890189611b57565b6040516020016106a393929190611c7c565b60408051601f198184030181529181526106c290880160208901611b57565b6001600160a01b031690610e9f565b95945050505050565b6000816107295760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161040f565b6107698484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ee392505050565b60008181526020819052604090206001015490915061082c576107cc61078d610f15565b6040516bffffffffffffffffffffffff19606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b84036107dd576107dd61021d610f15565b6107e78185610f24565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585610814610f15565b60405161082393929190611ca2565b60405180910390a35b61083881610161610f15565b9392505050565b6001600160a01b0381166108955760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161040f565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610422576108ff8183610bb5565b816001600160a01b0316817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d610933610f15565b6040516001600160a01b03909116815260200160405180910390a35050565b61095f6020820182611b57565b6001600160a01b0316610970610f15565b6001600160a01b0316146109c65760405162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d6574612d747820736f7572636500000000000000604482015260640161040f565b6109cf81610cec565b6040517f76faa962e536b8049aa3d58c074226dc3892669e0529b6722b618abdc17a1a3f90600090a250565b6060818067ffffffffffffffff811115610a1757610a17611bf9565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50915060005b81811015610b7457600030868684818110610a6d57610a6d611c0f565b9050602002810190610a7f9190611c25565b604051610a8d929190611c6c565b600060405180830381855af49150503d8060008114610ac8576040519150601f19603f3d011682016040523d82523d6000602084013e610acd565b606091505b50858481518110610ae057610ae0611c0f565b6020908102919091010152905080610b6b576000848381518110610b0657610b06611c0f565b60200260200101519050600081511115610b235780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161040f565b50600101610a50565b505092915050565b600082815260208190526040902060010154610b9781610ba1565b6103888383610f6f565b610bb281610bad610f15565b61100c565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610c10610f15565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c5c610f15565b6001600160a01b0316816001600160a01b031614610ce25760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161040f565b6104228282610f6f565b6000610da57feb7570743e0c7ddd184b4a7bbb0938300819da235addf7adbe52ac0fd355d621610d1f6020850185611b57565b610d2f6040860160208701611b57565b610d3c6040870187611c25565b604051610d4a929190611c6c565b6040805191829003822060208301959095526001600160a01b0393841690820152911660608083019190915260808201929092529084013560a082015260c0016040516020818303038152906040528051906020012061107f565b60008181526001602052604090205490915060ff1615610e075760405162461bcd60e51b815260206004820152601c60248201527f4d6574612d7478206578656375746564206f722063616e63656c656400000000604482015260640161040f565b42826060013511610e5a5760405162461bcd60e51b815260206004820152600f60248201527f4d6574612d747820657870697265640000000000000000000000000000000000604482015260640161040f565b6000818152600160208190526040909120805460ff19169091179055919050565b6000806000610e8a8585611092565b91509150610e97816110d7565b509392505050565b6060610838838360006040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061123c565b60006108388383604051602001610efa9190611ce4565b60405160208183030381529060405280519060200120611330565b6000610f1f611366565b905090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610422576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055610fc8610f15565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166104225761103d816113aa565b6110488360206113bc565b604051602001611059929190611d00565b60408051601f198184030181529082905262461bcd60e51b825261040f91600401611b44565b600061035d61108c61159d565b836116c4565b60008082516041036110c85760208301516040840151606085015160001a6110bc87828585611706565b945094505050506110d0565b506000905060025b9250929050565b60008160048111156110eb576110eb611d81565b036110f35750565b600181600481111561110757611107611d81565b036111545760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161040f565b600281600481111561116857611168611d81565b036111b55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161040f565b60038160048111156111c9576111c9611d81565b03610bb25760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161040f565b6060824710156112b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161040f565b600080866001600160a01b031685876040516112d09190611ce4565b60006040518083038185875af1925050503d806000811461130d576040519150601f19603f3d011682016040523d82523d6000602084013e611312565b606091505b5091509150611323878383876117ca565b925050505b949350505050565b60408051602081018490529081018290526000906060015b60405160208183030381529060405280519060200120905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036113a5575060131936013560601c90565b503390565b606061035d6001600160a01b03831660145b606060006113cb836002611dad565b6113d6906002611dc4565b67ffffffffffffffff8111156113ee576113ee611bf9565b6040519080825280601f01601f191660200182016040528015611418576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061144f5761144f611c0f565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061149a5761149a611c0f565b60200101906001600160f81b031916908160001a90535060006114be846002611dad565b6114c9906001611dc4565b90505b600181111561154e577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061150a5761150a611c0f565b1a60f81b82828151811061152057611520611c0f565b60200101906001600160f81b031916908160001a90535060049490941c9361154781611dd7565b90506114cc565b5083156108385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161040f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156115f657507f000000000000000000000000000000000000000000000000000000000000000046145b1561162057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810183905260428101829052600090606201611348565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561173d57506000905060036117c1565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611791573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166117ba576000600192509250506117c1565b9150600090505b94509492505050565b60608315611839578251600003611832576001600160a01b0385163b6118325760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161040f565b5081611328565b611328838381511561184e5781518083602001fd5b8060405162461bcd60e51b815260040161040f9190611b44565b60006020828403121561187a57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461083857600080fd5b6000602082840312156118bc57600080fd5b5035919050565b80356001600160a01b03811681146118da57600080fd5b919050565b600080604083850312156118f257600080fd5b82359150611902602084016118c3565b90509250929050565b6000806020838503121561191e57600080fd5b823567ffffffffffffffff8082111561193657600080fd5b818501915085601f83011261194a57600080fd5b81358181111561195957600080fd5b8660208260051b850101111561196e57600080fd5b60209290920196919550909350505050565b60005b8381101561199b578181015183820152602001611983565b50506000910152565b600081518084526119bc816020860160208601611980565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015611a1b57601f19868403018952611a098383516119a4565b988401989250908301906001016119ed565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611a63578151151584529284019290840190600101611a45565b50505083810382850152611a7781866119d0565b9695505050505050565b600060808284031215611a9357600080fd5b50919050565b60008083601f840112611aab57600080fd5b50813567ffffffffffffffff811115611ac357600080fd5b6020830191508360208285010111156110d057600080fd5b600080600060408486031215611af057600080fd5b833567ffffffffffffffff80821115611b0857600080fd5b611b1487838801611a81565b94506020860135915080821115611b2a57600080fd5b50611b3786828701611a99565b9497909650939450505050565b60208152600061083860208301846119a4565b600060208284031215611b6957600080fd5b610838826118c3565b600080600060408486031215611b8757600080fd5b83359250602084013567ffffffffffffffff811115611ba557600080fd5b611b3786828701611a99565b600060208284031215611bc357600080fd5b813567ffffffffffffffff811115611bda57600080fd5b61132884828501611a81565b60208152600061083860208301846119d0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611c3c57600080fd5b83018035915067ffffffffffffffff821115611c5757600080fd5b6020019150368190038213156110d057600080fd5b8183823760009101908152919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611cf6818460208701611980565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d38816017850160208801611980565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611d75816028840160208801611980565b01602801949350505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761035d5761035d611d97565b8082018082111561035d5761035d611d97565b600081611de657611de6611d97565b50600019019056fea2646970667358221220ec402ca8af3fec4d2cd7aa47bfc9a392a942986537ec78d51678d3db2495ed5c64736f6c63430008110033", + "numDeployments": 1, + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { - "cancel((address,address,bytes,uint256))": { - "details": "This can be used to cancel meta-txes that were issued accidentally, e.g., with an unreasonably large expiration timestamp, which may create a dangling liability", - "params": { - "metaTx": "Meta-tx" - } - }, - "constructor": { - "details": "AccessControlRegistry is its own trusted meta-tx forwarder" - }, - "execute((address,address,bytes,uint256),bytes)": { - "params": { - "metaTx": "Meta-tx", - "signature": "Meta-tx hash signed by `from`" - }, - "returns": { - "returndata": "Returndata" - } - }, "getRoleAdmin(bytes32)": { "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." }, @@ -601,21 +430,12 @@ "userdoc": { "kind": "user", "methods": { - "cancel((address,address,bytes,uint256))": { - "notice": "Called by a meta-tx source to prevent it from being executed" - }, - "execute((address,address,bytes,uint256),bytes)": { - "notice": "Verifies the signature and executes the meta-tx" - }, "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" }, - "metaTxWithHashIsExecutedOrCanceled(bytes32)": { - "notice": "If the meta-tx with hash is executed or canceled" - }, "multicall(bytes[])": { "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" }, @@ -638,14 +458,6 @@ "offset": 0, "slot": "0", "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 16941, - "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", - "label": "metaTxWithHashIsExecutedOrCanceled", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_bool)" } ], "types": { @@ -671,13 +483,6 @@ "numberOfBytes": "32", "value": "t_bool" }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { "encoding": "mapping", "key": "t_bytes32", diff --git a/deployments/scroll-goerli-testnet/Api3ServerV1.json b/deployments/scroll-goerli-testnet/Api3ServerV1.json index 0b95f78d..7888e9a0 100644 --- a/deployments/scroll-goerli-testnet/Api3ServerV1.json +++ b/deployments/scroll-goerli-testnet/Api3ServerV1.json @@ -1,5 +1,5 @@ { - "address": "0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76", + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", "abi": [ { "inputs": [ @@ -741,32 +741,32 @@ "type": "function" } ], - "transactionHash": "0x736bc028a7f9ed67cdf2134d23c690756c7da1185ee5e29d5de30a95a463732f", + "transactionHash": "0x493013fbe98ba4b436f0740f236ac713ab556e04647c31aee46e8f51c7a1d8f4", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 5, + "transactionIndex": 0, "gasUsed": "2960756", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xe0aaaa2365ac04690eff4333adb776b7cdfd21ade054eaec321c08bf1e229153", - "transactionHash": "0x736bc028a7f9ed67cdf2134d23c690756c7da1185ee5e29d5de30a95a463732f", + "blockHash": "0x513bb09b7c49e1285f321142a6e90f09227c988d51aeb5c1a8bca99317306f50", + "transactionHash": "0x493013fbe98ba4b436f0740f236ac713ab556e04647c31aee46e8f51c7a1d8f4", "logs": [], - "blockNumber": 3833217, - "cumulativeGasUsed": "4325028", + "blockNumber": 5856671, + "cumulativeGasUsed": "2960756", "status": 1, "byzantium": true }, "args": [ - "0x12D82f38a038A71b0843BD3256CD1E0A1De74834", + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "Api3ServerV1 admin", "0x81bc85f329cDB28936FbB239f734AE495121F9A6" ], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", - "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/IExpiringMetaTxForwarder.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is\\n IAccessControl,\\n IExpiringMetaTxForwarder,\\n ISelfMulticall\\n{\\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\":\"0xfe3f55a43a4456091ab90f4c17d4feda383587a5bbd3b7313295d87d878d843b\",\"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/IExpiringMetaTxForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IExpiringMetaTxForwarder {\\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\\n\\n event CanceledMetaTx(bytes32 indexed metaTxHash);\\n\\n struct ExpiringMetaTx {\\n address from;\\n address to;\\n bytes data;\\n uint256 expirationTimestamp;\\n }\\n\\n function execute(\\n ExpiringMetaTx calldata metaTx,\\n bytes calldata signature\\n ) external returns (bytes memory returndata);\\n\\n function cancel(ExpiringMetaTx calldata metaTx) external;\\n\\n function metaTxWithHashIsExecutedOrCanceled(\\n bytes32 metaTxHash\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x07dd88733178b59486717a0b8a2027afcf3fbb5cc475166ee75327a683c7fa45\",\"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": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", - "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220725ac8fad1349122a0e4216edecf75a3de60cac740e565e1e012ee66b707a0fa64736f6c63430008110033", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", + "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": { @@ -1010,7 +1010,7 @@ "storageLayout": { "storage": [ { - "astId": 6255, + "astId": 6210, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "adminRoleDescription", "offset": 0, @@ -1018,23 +1018,23 @@ "type": "t_string_storage" }, { - "astId": 7582, + "astId": 7534, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "_dataFeeds", "offset": 0, "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "type": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, { - "astId": 8071, + "astId": 8023, "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)7576_storage))" + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))" }, { - "astId": 8077, + "astId": 8029, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "oevProxyToBalance", "offset": 0, @@ -1042,7 +1042,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 7404, + "astId": 7356, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "dapiNameHashToDataFeedId", "offset": 0, @@ -1066,12 +1066,12 @@ "label": "int224", "numberOfBytes": "28" }, - "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7576_storage))": { + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)7528_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", "numberOfBytes": "32", - "value": "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)" + "value": "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1087,24 +1087,24 @@ "numberOfBytes": "32", "value": "t_bytes32" }, - "t_mapping(t_bytes32,t_struct(DataFeed)7576_storage)": { + "t_mapping(t_bytes32,t_struct(DataFeed)7528_storage)": { "encoding": "mapping", "key": "t_bytes32", "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", "numberOfBytes": "32", - "value": "t_struct(DataFeed)7576_storage" + "value": "t_struct(DataFeed)7528_storage" }, "t_string_storage": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, - "t_struct(DataFeed)7576_storage": { + "t_struct(DataFeed)7528_storage": { "encoding": "inplace", "label": "struct DataFeedServer.DataFeed", "members": [ { - "astId": 7573, + "astId": 7525, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "value", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_int224" }, { - "astId": 7575, + "astId": 7527, "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", "label": "timestamp", "offset": 28, diff --git a/deployments/scroll-goerli-testnet/ProxyFactory.json b/deployments/scroll-goerli-testnet/ProxyFactory.json index adfe816d..8625496e 100644 --- a/deployments/scroll-goerli-testnet/ProxyFactory.json +++ b/deployments/scroll-goerli-testnet/ProxyFactory.json @@ -1,5 +1,5 @@ { - "address": "0xd9cB76bcAE7219Fb3cB1936401804D7c9F921bCD", + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "abi": [ { "inputs": [ @@ -350,25 +350,25 @@ "type": "function" } ], - "transactionHash": "0x6f8efd856ea1e433379fd8cddfd6b8ce80b530bf57a47eac470c0d1868331e2e", + "transactionHash": "0xdeca21c6fdd78f697233604c37a24369ee76fa84aab4e477b7400c050a5d1673", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", "contractAddress": null, - "transactionIndex": 5, + "transactionIndex": 0, "gasUsed": "1472737", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf63c102e8b9317dc8a98b690880d67801c0a46aad3fa2b172c8819474e3c5e87", - "transactionHash": "0x6f8efd856ea1e433379fd8cddfd6b8ce80b530bf57a47eac470c0d1868331e2e", + "blockHash": "0xcc6979ad86b2ac2d9f83ec8fc0b4b9e2118baf24272a0cbda05647e6d3f9d0cb", + "transactionHash": "0xdeca21c6fdd78f697233604c37a24369ee76fa84aab4e477b7400c050a5d1673", "logs": [], - "blockNumber": 3833220, - "cumulativeGasUsed": "2612792", + "blockNumber": 5856672, + "cumulativeGasUsed": "1472737", "status": 1, "byzantium": true }, - "args": ["0x3dEC619dc529363767dEe9E71d8dD1A5bc270D76"], + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], "numDeployments": 1, - "solcInputHash": "f757cd61e82e69b4ad628d64e66c2833", + "solcInputHash": "76975463642f13e8363e0f61bd6120e1", "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", diff --git a/deployments/scroll-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json b/deployments/scroll-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json new file mode 100644 index 00000000..3f7a270e --- /dev/null +++ b/deployments/scroll-goerli-testnet/solcInputs/76975463642f13e8363e0f61bd6120e1.json @@ -0,0 +1,369 @@ +{ + "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/metatx/ERC2771Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.9;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771Context is Context {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address private immutable _trustedForwarder;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(address trustedForwarder) {\n _trustedForwarder = trustedForwarder;\n }\n\n function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n function _msgSender() internal view virtual override returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n /// @solidity memory-safe-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return super._msgSender();\n }\n }\n\n function _msgData() internal view virtual override returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return super._msgData();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\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/Counters.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary Counters {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\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/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * _Available since v3.4._\n */\nabstract contract EIP712 {\n /* solhint-disable var-name-mixedcase */\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n\n bytes32 private immutable _HASHED_NAME;\n bytes32 private immutable _HASHED_VERSION;\n bytes32 private immutable _TYPE_HASH;\n\n /* solhint-enable var-name-mixedcase */\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n bytes32 hashedVersion = keccak256(bytes(version));\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n _HASHED_NAME = hashedName;\n _HASHED_VERSION = hashedVersion;\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);\n _CACHED_THIS = address(this);\n _TYPE_HASH = typeHash;\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), 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, _msgSender());\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: _msgSender(),\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n _msgSender()\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, _msgSender()),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n\n /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(Allocator, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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 _msgSender()\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 _msgSender()\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 ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][_msgSender()] = 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 _msgSender()\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 _msgSender()\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 /// @dev See Context.sol\n function _msgSender() internal view virtual returns (address sender);\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 _msgSender()\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 _msgSender()\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, _msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n _msgSender()\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, _msgSender());\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n _msgSender()\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 _msgSender()\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 == _msgSender() ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n _msgSender()\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, _msgSender());\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][_msgSender()];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[_msgSender()];\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[_msgSender()].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[_msgSender()] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n _msgSender()\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n _msgSender(),\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n _msgSender(),\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[\n _msgSender()\n ];\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 _msgSender(),\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][_msgSender()],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[\n _msgSender()\n ];\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[_msgSender()] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n _msgSender(),\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), _msgSender(), 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 \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\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 ERC2771Context,\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 ERC2771Context(_accessControlRegistry)\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(_msgSender()),\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(_msgSender()),\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(_msgSender()),\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 /// @dev See Context.sol\n function _msgSender()\n internal\n view\n virtual\n override(RequesterAuthorizer, ERC2771Context)\n returns (address)\n {\n return ERC2771Context._msgSender();\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/ExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IExpiringMetaTxForwarder.sol\";\n\n/// @title Contract that forwards expiring meta-txes to ERC2771 contracts that\n/// trust it\n/// @notice `msg.value` is not supported. Identical meta-txes are not\n/// supported. Target account must be a contract. Signer of the meta-tx is\n/// allowed to cancel it before execution, effectively rendering the signature\n/// useless.\n/// This implementation is not intended to be used with general-purpose relayer\n/// networks. Instead, it is meant for use-cases where the relayer wants the\n/// signer to send a tx, so they request a meta-tx and execute it themselves to\n/// cover the gas cost.\n/// @dev This implementation does not use signer-specific nonces for meta-txes\n/// to be executable in an arbitrary order. For example, one can sign two\n/// meta-txes that will whitelist an account each and deliver these to the\n/// respective owners of the accounts. This implementation allows the account\n/// owners to not care about if and when the other meta-tx is executed. The\n/// signer is responsible for not issuing signatures that may cause undesired\n/// race conditions.\ncontract ExpiringMetaTxForwarder is Context, EIP712, IExpiringMetaTxForwarder {\n using ECDSA for bytes32;\n using Address for address;\n\n /// @notice If the meta-tx with hash is executed or canceled\n /// @dev We track this on a meta-tx basis and not by using nonces to avoid\n /// requiring users keep track of nonces\n mapping(bytes32 => bool) public override metaTxWithHashIsExecutedOrCanceled;\n\n bytes32 private constant _TYPEHASH =\n keccak256(\n \"ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)\"\n );\n\n constructor() EIP712(\"ExpiringMetaTxForwarder\", \"1.0.0\") {}\n\n /// @notice Verifies the signature and executes the meta-tx\n /// @param metaTx Meta-tx\n /// @param signature Meta-tx hash signed by `from`\n /// @return returndata Returndata\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external override returns (bytes memory returndata) {\n bytes32 metaTxHash = processMetaTx(metaTx);\n require(\n metaTxHash.recover(signature) == metaTx.from,\n \"Invalid signature\"\n );\n emit ExecutedMetaTx(metaTxHash);\n returndata = metaTx.to.functionCall(\n abi.encodePacked(metaTx.data, metaTx.from)\n );\n }\n\n /// @notice Called by a meta-tx source to prevent it from being executed\n /// @dev This can be used to cancel meta-txes that were issued\n /// accidentally, e.g., with an unreasonably large expiration timestamp,\n /// which may create a dangling liability\n /// @param metaTx Meta-tx\n function cancel(ExpiringMetaTx calldata metaTx) external override {\n require(_msgSender() == metaTx.from, \"Sender not meta-tx source\");\n emit CanceledMetaTx(processMetaTx(metaTx));\n }\n\n /// @notice Checks if the meta-tx is valid, invalidates it for future\n /// execution or nullification, and returns the meta-tx hash\n /// @param metaTx Meta-tx\n /// @return metaTxHash Meta-tx hash\n function processMetaTx(\n ExpiringMetaTx calldata metaTx\n ) private returns (bytes32 metaTxHash) {\n metaTxHash = _hashTypedDataV4(\n keccak256(\n abi.encode(\n _TYPEHASH,\n metaTx.from,\n metaTx.to,\n keccak256(metaTx.data),\n metaTx.expirationTimestamp\n )\n )\n );\n require(\n !metaTxWithHashIsExecutedOrCanceled[metaTxHash],\n \"Meta-tx executed or canceled\"\n );\n require(\n metaTx.expirationTimestamp > block.timestamp,\n \"Meta-tx expired\"\n );\n metaTxWithHashIsExecutedOrCanceled[metaTxHash] = true;\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/IExpiringMetaTxForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExpiringMetaTxForwarder {\n event ExecutedMetaTx(bytes32 indexed metaTxHash);\n\n event CanceledMetaTx(bytes32 indexed metaTxHash);\n\n struct ExpiringMetaTx {\n address from;\n address to;\n bytes data;\n uint256 expirationTimestamp;\n }\n\n function execute(\n ExpiringMetaTx calldata metaTx,\n bytes calldata signature\n ) external returns (bytes memory returndata);\n\n function cancel(ExpiringMetaTx calldata metaTx) external;\n\n function metaTxWithHashIsExecutedOrCanceled(\n bytes32 metaTxHash\n ) external returns (bool);\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/IPrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IPrepaymentDepository is IAccessControlRegistryAdminnedWithManager {\n event SetWithdrawalDestination(\n address indexed user,\n address withdrawalDestination\n );\n\n event IncreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event DecreasedUserWithdrawalLimit(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Claimed(address recipient, uint256 amount, address sender);\n\n event Deposited(\n address indexed user,\n uint256 amount,\n uint256 withdrawalLimit,\n address sender\n );\n\n event Withdrew(\n address indexed user,\n bytes32 indexed withdrawalHash,\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n address withdrawalDestination,\n uint256 withdrawalLimit\n );\n\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external;\n\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function claim(address recipient, uint256 amount) external;\n\n function deposit(\n address user,\n uint256 amount\n ) external returns (uint256 withdrawalLimit);\n\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external returns (uint256 withdrawalLimit);\n\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n ) external returns (address withdrawalDestination, uint256 withdrawalLimit);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function CLAIMER_ROLE_DESCRIPTION() external view returns (string memory);\n\n function withdrawalSignerRole() external view returns (bytes32);\n\n function userWithdrawalLimitIncreaserRole() external view returns (bytes32);\n\n function userWithdrawalLimitDecreaserRole() external view returns (bytes32);\n\n function claimerRole() external view returns (bytes32);\n\n function token() external view returns (address);\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/MockErc20PermitToken.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/utils/Counters.sol\";\n\n// It is not possible to override the EIP712 version of\n// @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol\n// so it is copy-pasted below with the version \"2\" to imitate USDC\n\n/**\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * _Available since v3.4._\n */\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private constant _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n /**\n * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.\n * However, to ensure consistency with the upgradeable transpiler, we will continue\n * to reserve a slot.\n * @custom:oz-renamed-from _PERMIT_TYPEHASH\n */\n // solhint-disable-next-line var-name-mixedcase\n bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;\n\n /**\n * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\"1\"`.\n *\n * It's a good idea to use the same `name` that is defined as the ERC20 token name.\n */\n constructor(string memory name) EIP712(name, \"2\") {}\n\n /**\n * @dev See {IERC20Permit-permit}.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual override {\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n address signer = ECDSA.recover(hash, v, r, s);\n require(signer == owner, \"ERC20Permit: invalid signature\");\n\n _approve(owner, spender, value);\n }\n\n /**\n * @dev See {IERC20Permit-nonces}.\n */\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n /**\n * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n /**\n * @dev \"Consume a nonce\": return the current value and increment.\n *\n * _Available since v4.1._\n */\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n current = nonce.current();\n nonce.increment();\n }\n}\n\ncontract MockErc20PermitToken is ERC20Permit {\n constructor(address recipient) ERC20(\"Token\", \"TKN\") ERC20Permit(\"Token\") {\n _mint(recipient, 1e9 * 10 ** decimals());\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 6;\n }\n}\n" + }, + "contracts/utils/mock/MockExpiringMetaTxForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/metatx/ERC2771Context.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract MockExpiringMetaTxForwarderTarget is ERC2771Context, Ownable {\n uint256 public counter = 0;\n\n constructor(\n address _trustedForwarder,\n address _owner\n ) ERC2771Context(_trustedForwarder) {\n _transferOwnership(_owner);\n }\n\n function incrementCounter() external onlyOwner returns (uint256) {\n return ++counter;\n }\n\n function _msgSender()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (address sender)\n {\n return ERC2771Context._msgSender();\n }\n\n function _msgData()\n internal\n view\n virtual\n override(Context, ERC2771Context)\n returns (bytes calldata)\n {\n return ERC2771Context._msgData();\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/PrepaymentDepository.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IPrepaymentDepository.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\";\n\n/// @title Contract that enables micropayments to be prepaid in batch\n/// @notice `manager` represents the payment recipient, and its various\n/// privileges can be delegated to other accounts through respective roles.\n/// `manager`, `userWithdrawalLimitIncreaser` and `claimer` roles should only\n/// be granted to a multisig or an equivalently decentralized account.\n/// `withdrawalSigner` issues ERC191 signatures, and thus has to be an EOA. It\n/// being compromised poses a risk in proportion to the redundancy in user\n/// withdrawal limits. Have a `userWithdrawalLimitDecreaser` decrease user\n/// withdrawal limits as necessary to mitigate this risk.\n/// The `userWithdrawalLimitDecreaser` role can be granted to an EOA, as it\n/// cannot cause irreversible harm.\n/// This contract accepts prepayments in an ERC20 token specified immutably\n/// during construction. Do not use tokens that are not fully ERC20-compliant.\n/// An optional `depositWithPermit()` function is added to provide ERC2612\n/// support.\ncontract PrepaymentDepository is\n AccessControlRegistryAdminnedWithManager,\n IPrepaymentDepository\n{\n using ECDSA for bytes32;\n\n /// @notice Withdrawal signer role description\n string public constant override WITHDRAWAL_SIGNER_ROLE_DESCRIPTION =\n \"Withdrawal signer\";\n /// @notice User withdrawal limit increaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit increaser\";\n /// @notice User withdrawal limit decreaser role description\n string\n public constant\n override USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION =\n \"User withdrawal limit decreaser\";\n /// @notice Claimer role description\n string public constant override CLAIMER_ROLE_DESCRIPTION = \"Claimer\";\n\n // We prefer revert strings over custom errors because not all chains and\n // block explorers support custom errors\n string private constant AMOUNT_ZERO_REVERT_STRING = \"Amount zero\";\n string private constant AMOUNT_EXCEEDS_LIMIT_REVERT_STRING =\n \"Amount exceeds limit\";\n string private constant TRANSFER_UNSUCCESSFUL_REVERT_STRING =\n \"Transfer unsuccessful\";\n\n /// @notice Withdrawal signer role\n bytes32 public immutable override withdrawalSignerRole;\n /// @notice User withdrawal limit increaser role\n bytes32 public immutable override userWithdrawalLimitIncreaserRole;\n /// @notice User withdrawal limit decreaser role\n bytes32 public immutable override userWithdrawalLimitDecreaserRole;\n /// @notice Claimer role\n bytes32 public immutable override claimerRole;\n\n /// @notice Contract address of the ERC20 token that prepayments can be\n /// made in\n address public immutable override token;\n\n /// @notice Returns the withdrawal destination of the user\n mapping(address => address) public userToWithdrawalDestination;\n\n /// @notice Returns the withdrawal limit of the user\n mapping(address => uint256) public userToWithdrawalLimit;\n\n /// @notice Returns if the withdrawal with the hash is executed\n mapping(bytes32 => bool) public withdrawalWithHashIsExecuted;\n\n /// @param user User address\n /// @param amount Amount\n /// @dev Reverts if user address or amount is zero\n modifier onlyNonZeroUserAddressAndAmount(address user, uint256 amount) {\n require(user != address(0), \"User address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n /// @param _token Contract address of the ERC20 token that prepayments are\n /// made in\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _token\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n require(_token != address(0), \"Token address zero\");\n token = _token;\n withdrawalSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWAL_SIGNER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitIncreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_INCREASER_ROLE_DESCRIPTION\n );\n userWithdrawalLimitDecreaserRole = _deriveRole(\n _deriveAdminRole(manager),\n USER_WITHDRAWAL_LIMIT_DECREASER_ROLE_DESCRIPTION\n );\n claimerRole = _deriveRole(\n _deriveAdminRole(manager),\n CLAIMER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the user that has not set a withdrawal destination to\n /// set a withdrawal destination, or called by the withdrawal destination\n /// of a user to set a new withdrawal destination\n /// @param user User address\n /// @param withdrawalDestination Withdrawal destination\n function setWithdrawalDestination(\n address user,\n address withdrawalDestination\n ) external override {\n require(user != withdrawalDestination, \"Same user and destination\");\n require(\n (msg.sender == user &&\n userToWithdrawalDestination[user] == address(0)) ||\n (msg.sender == userToWithdrawalDestination[user]),\n \"Sender not destination\"\n );\n userToWithdrawalDestination[user] = withdrawalDestination;\n emit SetWithdrawalDestination(user, withdrawalDestination);\n }\n\n /// @notice Called to increase the withdrawal limit of the user\n /// @dev This function is intended to be used to revert faulty\n /// `decreaseUserWithdrawalLimit()` calls\n /// @param user User address\n /// @param amount Amount to increase the withdrawal limit by\n /// @return withdrawalLimit Increased withdrawal limit\n function increaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitIncreaserRole,\n msg.sender\n ),\n \"Cannot increase withdrawal limit\"\n );\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit IncreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to decrease the withdrawal limit of the user\n /// @param user User address\n /// @param amount Amount to decrease the withdrawal limit by\n /// @return withdrawalLimit Decreased withdrawal limit\n function decreaseUserWithdrawalLimit(\n address user,\n uint256 amount\n )\n external\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n userWithdrawalLimitDecreaserRole,\n msg.sender\n ),\n \"Cannot decrease withdrawal limit\"\n );\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[user];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit DecreasedUserWithdrawalLimit(\n user,\n amount,\n withdrawalLimit,\n msg.sender\n );\n }\n\n /// @notice Called to claim tokens\n /// @param recipient Recipient address\n /// @param amount Amount of tokens to claim\n function claim(address recipient, uint256 amount) external override {\n require(recipient != address(0), \"Recipient address zero\");\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n claimerRole,\n msg.sender\n ),\n \"Cannot claim\"\n );\n emit Claimed(recipient, amount, msg.sender);\n require(\n IERC20(token).transfer(recipient, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to deposit tokens on behalf of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @return withdrawalLimit Increased withdrawal limit\n function deposit(\n address user,\n uint256 amount\n )\n public\n override\n onlyNonZeroUserAddressAndAmount(user, amount)\n returns (uint256 withdrawalLimit)\n {\n withdrawalLimit = userToWithdrawalLimit[user] + amount;\n userToWithdrawalLimit[user] = withdrawalLimit;\n emit Deposited(user, amount, withdrawalLimit, msg.sender);\n require(\n IERC20(token).transferFrom(msg.sender, address(this), amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\n );\n }\n\n /// @notice Called to apply a ERC2612 permit and deposit tokens on behalf\n /// of a user\n /// @param user User address\n /// @param amount Amount of tokens to deposit\n /// @param deadline Deadline of the permit\n /// @param v v component of the signature\n /// @param r r component of the signature\n /// @param s s component of the signature\n /// @return withdrawalLimit Increased withdrawal limit\n function applyPermitAndDeposit(\n address user,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external override returns (uint256 withdrawalLimit) {\n IERC20Permit(token).permit(\n msg.sender,\n address(this),\n amount,\n deadline,\n v,\n r,\n s\n );\n withdrawalLimit = deposit(user, amount);\n }\n\n /// @notice Called by a user to withdraw tokens\n /// @param amount Amount of tokens to withdraw\n /// @param expirationTimestamp Expiration timestamp of the signature\n /// @param withdrawalSigner Address of the account that signed the\n /// withdrawal\n /// @param signature Withdrawal signature\n /// @return withdrawalDestination Withdrawal destination\n /// @return withdrawalLimit Decreased withdrawal limit\n function withdraw(\n uint256 amount,\n uint256 expirationTimestamp,\n address withdrawalSigner,\n bytes calldata signature\n )\n external\n override\n returns (address withdrawalDestination, uint256 withdrawalLimit)\n {\n require(amount != 0, AMOUNT_ZERO_REVERT_STRING);\n require(block.timestamp < expirationTimestamp, \"Signature expired\");\n bytes32 withdrawalHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n amount,\n expirationTimestamp\n )\n );\n require(\n !withdrawalWithHashIsExecuted[withdrawalHash],\n \"Withdrawal already executed\"\n );\n require(\n withdrawalSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawalSignerRole,\n withdrawalSigner\n ),\n \"Cannot sign withdrawal\"\n );\n require(\n (withdrawalHash.toEthSignedMessageHash()).recover(signature) ==\n withdrawalSigner,\n \"Signature mismatch\"\n );\n withdrawalWithHashIsExecuted[withdrawalHash] = true;\n uint256 oldWithdrawalLimit = userToWithdrawalLimit[msg.sender];\n require(\n amount <= oldWithdrawalLimit,\n AMOUNT_EXCEEDS_LIMIT_REVERT_STRING\n );\n withdrawalLimit = oldWithdrawalLimit - amount;\n userToWithdrawalLimit[msg.sender] = withdrawalLimit;\n if (userToWithdrawalDestination[msg.sender] == address(0)) {\n withdrawalDestination = msg.sender;\n } else {\n withdrawalDestination = userToWithdrawalDestination[msg.sender];\n }\n emit Withdrew(\n msg.sender,\n withdrawalHash,\n amount,\n expirationTimestamp,\n withdrawalSigner,\n withdrawalDestination,\n withdrawalLimit\n );\n require(\n IERC20(token).transfer(withdrawalDestination, amount),\n TRANSFER_UNSUCCESSFUL_REVERT_STRING\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/zksync-goerli-testnet/AccessControlRegistry.json b/deployments/zksync-goerli-testnet/AccessControlRegistry.json deleted file mode 100644 index 84b257a5..00000000 --- a/deployments/zksync-goerli-testnet/AccessControlRegistry.json +++ /dev/null @@ -1,581 +0,0 @@ -{ - "address": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "transactionIndex": 25, - "root": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "gasUsed": { "type": "BigNumber", "hex": "0x0229b004" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "transactionHash": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "logs": [ - { - "transactionIndex": 25, - "blockNumber": 3197308, - "transactionHash": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x0000000000000000000000000000000000000000000000000035ae6f53495b00", - "logIndex": 147, - "blockHash": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 25, - "blockNumber": 3197308, - "transactionHash": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x000000000000000000000000000000000000000000000000000e4707aaaa5d00", - "logIndex": 148, - "blockHash": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 25, - "blockNumber": 3197308, - "transactionHash": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x010003434fee1c75e5ca83c5574aa5d9058caab3cf105a33336f85fe6cd747f8", - "0x000000000000000000000000faf0129b9c1fa35c8a9b1e664dd6247ae624c002" - ], - "data": "0x", - "logIndex": 149, - "blockHash": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 25, - "blockNumber": 3197308, - "transactionHash": "0x327b5703bf7cd9b3e5ebb5d264d3174881ff2f53d60afda43f035c8b971ddc60", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x00000000000000000000000000000000000000000000000000072cd13bcc3400", - "logIndex": 150, - "blockHash": "0x4b89bccc44102ba94f49ae301c6742fb1a8da410f67e6af66356643151a1f7c7", - "l1BatchNumber": 33792 - } - ], - "blockNumber": 3197308, - "confirmations": 803, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0ee6b280" }, - "status": 1, - "type": 113, - "l1BatchNumber": 33792, - "l1BatchTxIndex": 39, - "l2ToL1Logs": [], - "byzantium": true - }, - "args": [] -} diff --git a/deployments/zksync-goerli-testnet/Api3ServerV1.json b/deployments/zksync-goerli-testnet/Api3ServerV1.json deleted file mode 100644 index 84d5cc6a..00000000 --- a/deployments/zksync-goerli-testnet/Api3ServerV1.json +++ /dev/null @@ -1,878 +0,0 @@ -{ - "address": "0x9104356BB320Ab72FffbDCfe979577fc78377821", - "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": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x9104356BB320Ab72FffbDCfe979577fc78377821", - "transactionIndex": 0, - "root": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "gasUsed": { "type": "BigNumber", "hex": "0x25fef55a" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x000000000000000000000000000000000000000000000000036734ca66efff40", - "logIndex": 0, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x00000000000000000000000000000000000000000000000000e7b63ad2bb82c0", - "logIndex": 1, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x0000000000000000000000000000000000008008", - "topics": [ - "0x3a36e47291f4201faf137fab081d92295bce2d53be2c6ca68ba82c7faa9ce241", - "0x000000000000000000000000000000000000000000000000000000000000800e", - "0x3bb7506038cd0b0f3ca1d4115458116a3836ebff61fc8355f338d42b0a5be957" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000006f6a07ce0000000000000000000000000100001900000000003204350000000000120435000000050100002916f10bfe0000040f000000000001042d0000000001010433000000000110004c0000000003000019000000b30000c13d0000000000100435000000000021043500000000010300190000000402000039000000240200003916f10bcb0000040f00000600010000410000000a0200002900000020020000390000000a01000029000000000201043316f10bf40000040f000e00000001001d000005c10110009c00000000010004160000000e02000029000005c101100197000013ba0000413d0000000005000019000000000200001900000000070000190000000e01000029000000000410004c16f116ef0000040f0000000e030000290000000001026019000000000200a0190000000003024019000005c1020000410000000001100031000000040100008a0000000002010019000000000202043300000032010000390000006402000039000005c802000041000000000600001900000000040204330000000000450435000000040210003900000024021000390000004402100039000005c108400197000005c106000041000e00000002001d000000000660004c000000000607c019000005c10880009c000000000898013f000000000a98004b000005c109300197000000000734004b00000000030504330000002002100039000000000023043516f116d10000040f0000000000130435ffffffffffffffff0000000006008019000000000706201900000000023100490000001b0100003900000020030000390000000d02000029000000410100003916f10be20000040f000000000101043b00000000040000190000007f0000213d0000002001100039000d00000001001d0000000201100367000000b30000213d00000040010000390000000d010000290000000401000039000000000202043b00000000001004390000000802000029000000000220004c000000030200002900000000010200190000000d03000029000000200310008c000000000303043b00000000010a00190000000001120019000000000112019f16f116ed0000040f000000000024043500000000002004350000000a030000290000000003010433000005c1050000410000000003030433000000000310004c16f114ce0000040f16f115160000040f0000004002100039000000400200003900000040011002100000000b0100002900000007010000290000000b0200002916f1153a0000040f000000040100002900000009020000290000000000410435000000090100002900000004020000290000000502000029000000000112004b000005c2011001970000000101000039000d00000002001d00000000020404330000007f0000c13d00000000001404350000000101200190000000000301001916f114860000040f16f1155e0000040f000000000550004c00000000020304330000000801000029000c00000001001d16f116de0000040f000005be0410009c00000001020000390000000c02000029000800000001001d0000000003020433000900000001001d000005c10330009c000005c104000041000d00000003001d0000145a0000a13d16f1165a0000040f16f115ca0000040f000013ba0000a13d000400000005001d000005c10550009c000100000002001d000000030110008c000000000404043b0000000202000029000000000320004c00000000010a04330000000000250435000500000001001d0000000c03000029000000010100c0390000800d02000039000000000203001900000001022001900000000403000029000000000440004c0000000c010000290000000601000029000b00000001001d000e00000003001d000000000330004c00000000030460190000800b0100003916f10c9a0000040f00000000010004140000002002200039000000040120003900000000020400190000000105500039000000440200003900008005010000390000000000120439000005f201000041000000000200003116f115ee0000040f000000060220008c000000000987004b000000030500002900000000020a043300000001020000290000006002100039000000400400003900000005011002100000004003000039000000000131001900000004050000290000000101000029000000000441001900000009030000290000000000430435000005c801000041000000040220008c000700000001001d0000000103300039000000000131004b000009a60000a13d000000000650004c000005ec011001c7000005c107300197000200000001001d000000200300008a00000001077000390000000e04000029000300000001001d00000001010020390000000201000039000c00000002001d00000004011000390000000003050019000000000400a01900000001020000310000000000540435000000000505043b000005c10300004100000020044000390000000506500210000000000540004c0000000000510435000000020320008c000000c005100039000013b00000013d000000050a00002916f114f20000040f16f115a60000040f16f114aa0000040f000000000506c019000005c10770009c000000000787013f000000000500a019000000000605a0190000000003430019000000600110003900000060022002100000000000340435000000c00110021000000005030000290000000000000435000005be0420009c000005be01000041000000000113004b00000006020000290000000000020435000000000756004b000000010660003900000000002104390000000001030433000000000121004b00000005022002100000000000670435000000000606043b16f10e770000040f000000000223004b0000002401000039000000b30000613d0000000e05000029000000c0023002100000000001028019000005be0430009c0000000003000414000005be02000041000600000001001d0000000102004039000000000121016f000000020220036700000000010400190000002001300039000005c10620019700000020024000390000000b0300002916f10d510000040f000000000300003100000001033001900000000000890435000000000760004c0000000702000029000005c30310009c000005c10330019716f10c780000040f000000e003100270000000200100003900000000040100190000000504300210000000000300a01900000000010000310000000000650435000000000606043300000001066001900000000106004039000000000500801900000000060580190000000504400210000000000645004b000000000707043b0000000001000412000000000301043b000000020100036769676e61747572656e76616c6964207345434453413a2069020000000000000064415049206e616d00000000ffffffff000000070220008c000015320000613d000000e005100039000000800510003900000003060000290000000005050433000000000a000019000013840000013d000013ba0000613d16f115820000040f000000000304c01900000000030a0433000005c108200197000000000623004b000000020110008c000013b80000013d000000010400008a16f113ca0000040f00000f480000a13d000000000304043300000002050000290000000103000029000006070120009c000000000502043300000005000000050005000000000002000100000001001d000000000523004b000000000203801900000002000000050002000000000002000000010000000516f116e30000040f000000000113019f000100000005001d0001000000000002000000000035043900000001040000290000000001050433000300000001035500000002040000290000002001200039000000c0022002100000000001044019000005be0320009c000000000200041416f1100b0000040f00020000000b001d0000001b03000039000000000252019f0000010003300089000000000535022f0000000303300210000000000530004c00000005044002700000001f0340018f00000002010000290000000301000029000800000003001d0000002001400039000000200500003900000005055002100000000000780435000000050760021016f110980000040f000000000402001916f110500000040f000000000534004b0000000104400039000000000221004b000000000120004c0000000c04000029000000000210004c0000000202100367000005c202100197000000020300003900000000030280190000000803000029000b00000003001d000000000112013f0000000000010435000001000550008900000003055002100000000000530435000000000403043316f10cde0000040f000000000242034f000300000002001d000005be0220019700000000002c043500000003022002100000000506600210000000000867004b000000000808043b0000000508700210000700000002001d000800000002001d16f10c7e0000040f0000000005044019000000200220008c000005c30410009c0000000105004039000000000102401916f10b730000040f0000000d050000290000000000560435000000200500008a000005c104400197000000000614004b000005c30420009c000000000520004c0000000b04000029000005c30750009c000005c10220009c000005c102200197000005c30430009c000005c10440009c00000000050404330000000301100210000000000510004c000000b30000413d000000040120008c000a00000001001d2075706461746520446f6573206e6f7465207a65726f00006368000000000000426561636f6e2073657373207a65726f0000169a0000413d000016760000413d0000162e0000413d0000160a0000613d000015e60000413d000015c20000413d000000050110008c000000a002100039000000050220008c000000040320008c000000030220008c0000006005100039000000010320008c000014c60000613d000000040110008c000000a0051000390000008002100039000000030320008c0000147e0000413d00000000005b0435000014570000613d16f114620000040f000000000405c019000005c10660009c000000000676013f000000000876004b000000000504a019000000000b010433000000000212004b16f1167e0000040f0000000000290435000000080230008c000000020a00002916f116360000040f16f116120000040f00000000002b0435000000000565013f000000000765004b000005c106800197000005c105200197000000000403a019000000000482004b000000020330008c000000000a010433000000e004a00039000000070110008c000000000634004b0000000004066019000000000405a019000000000423004b000000000605201900000000030c0433000000000112016f000000ff02300270000000010440018f000000000421016f00000000030260190000000004016019000000000445019f0000000105100270000000ff04400210000000000400c019000005c105100197000000000335019f0000000105200270000000ff03300210000005c1032001970000000002320019000000000323004b000000000413004b000000010320008a000000090120008c000011430000213d000010cc0000613d000000000600a0190000000505500270000000000431016f000000050520021000000017030000390000001303000039000000010550019016f1114e0000040f000400000001001d000000000121019f00000019030000390000006002300039000006050230009c000200000002001d00000060063000390000000005030433000000010210008c0000001f030000390000000000460435000000200310003900000002044003670000003f01200039000000000302001916f10cf10000040f000400000003001d000100000003001d000000000542001900000cc20000213d000000000224004b00000c970000213d0000000203100367000000000363013f000000000763004b0000001f031000390000001f022000390000004001400039000000400500003900000040042000390000004001100039000006040210009c000016f300010430000016f20001042e0000000001038019000005be03000041000105be0010019d0000006001100270000000000441034f000000010220018f0000000001058019000000000334019f00000060044002100000000004058019000005be0640009c00000040033002100000000003058019000005be0630009c000005be0500004116f10c2e0000040f16f10c150000040f000000040310003900000024031000390000004403100039000005fb011001c7000000a0020000390000000104400190000000000232013f000000000223022f000000010300008a0000002003300039000a00000002001d16f10e910000040f000000060600002900000005050000290000000403000039000005be0340009c0000000002018019000000000701043b000000030300002916f10f910000040f0000000101200270000000060300002900000000023201cf000000000232022f00000000053501cf000000000662034f00000000076100190000000104000031000000030200036700000000002304390000002005500039000e00000005001d0000000a05000029000005c2021001980000000501300210000000010500003900000000087300190000000005010019000005f10210009c000000400310008c0000000001020433000000010210018f0000000001210019000b00000002001d000000000601001916f10b960000040f0000000002230019000000000625004b000000000661034f000000000123004b16f116a20000040f000000000430004c0000000503300270000000000702001916f10cc50000040f0000000002032019000000000243004b0000000002042019000000e002100270000000e003400270000000000100041116f10e650000040f0000000000010439000005f10220019700000020043000390000004001200039000000000020043916f10f790000040f16f10d920000040f0000000101006039000005c20110019816f10dc50000040f16f10dfb0000040f16f10e4c0000040f000000000241004b0000000001140019000000200200008a0000004001a00039000000000272019f000000000757022f00000000075701cf00000000070604330000000006610019000000000750004c0000002003400039000900000002001d0000000001036019000000040120008a16f10c450000040f000000110300003916f110e70000040f0000000004008019000000000716004b00000000050420190000000202000367000000020210008c16f10fe20000040f0000000103004039000000000232016f000000000525022f0000010002200089000000000604043300000005040000290000000002000410000005e90100004116f10fd00000040f000000e001100270000400000002001d16f10fbe0000040f000000010100403900000e100110003916f10ca80000040f000005c30210009c0000002403100370000005c20330009c000600000003001d000000040310037000000003010000390000001803000039000005c20220009c0000000001340019000000600410018f0000001f01100039000000200120008c000000000443004b0000000004000031000000000324001900000000003104350000000001060019000000000114013f000000000403401900000000020560190000000002060019000000000272013f000000000872004b000005c107400197000900000003001d000005c104200197000005c10100004100000100011000890000000203000367000000600100003900000060033002700004000000000002696e67000000000076657274207374726c3a204e6f2072654d756c746963616c7465640000000000616c20726576657257697468647261776f6e730000000000616e7920426561637370656369667920446964206e6f742067206572726f7200706563617374696e56616c7565207479fffffffeffffffffffffffff80000000636f727265637400677468206e6f742044617461206c656e700000000000000074696d657374616d6c6964000000000070206e6f7420766154696d657374616d426561636f6e730068616e2074776f2064206c6573732074537065636966696565740000000000001a664b35be4b2349354a4d0f4ad0b7db8c56ac9613c09491b7712be6248d021effffffff000000006400000000000000697469616c697a6564206e6f7420696e4461746120666565740000000000000065206e6f742073653a0a333200000000204d6573736167656d205369676e65641945746865726575dfe92f46681b20a05d576e7357a4501d7fffffffffffffff206c656e67746800202773272076616c756500000000000065206d69736d61745369676e6174757200000000000000010000000100000000ffffffffffffffa0ffffffffffffffc00200000200000000464358975b36efb7da4d37d7219ba05e32e253bc4b8a17b91ffdb573afe727393c209e9336465bd123bf29dc2df74b6f266b0e7a08c0454b42cbb15ccdc3cad64e487b7100000000362f93160ef3e5634ba6bc95484008f6d60345a988386fc8290decd9548b62a8185087fc5553a5b60c39b067df172dd575ff1971e3f261046ef25c3ab4fb9cba617279206164647242656e6566696369792062616c616e634f45562070726f78d7d6958eddd9ca6ccafb79f92044ab338dfea1875af447840472be967f9a37130e15999d00000000023a8d90e8508b8302500962caba6a1568e884a7374b41e01806aa1896bbf2659f587339865294f51b6a6778d97fd9522cb5d9b3491cd5fcf3a9aac9b6ac0f840000002000000000616d650000000000742064415049206e616e6e6f7420736553656e646572206391d1485400000000ab882de59d99a32eff553aecb10793d015d089f94afb7896310ab089e4439a4c65000000000000007369676e617475724d697373696e6720ef1ea3a427a6a0eed4c044a35b0369c4366ad68f07eb69bac856aaa4e639403f44206d69736d6174426561636f6e20490c2cc65dc6568a7fdffe48c903d6bbbcea2ff0520d79f8efdd29860e0772a39d0000004000000000736d6174636800006574204944206d6974757265730000006768207369676e614e6f7420656e6f750d0df415241f670b5976f597df104ee23bc6df8224c17b489a8a0592ac89c5ad08cc6b5d955391325d622183e25ac5afcd93958e4c903827796b89b91644bc98125fc972a6507f396b1951864fbfc14e829bd487b90b72539cc7f708afc6594400000000009f2f3c00000000f8b2cb4f00000000f83ea10800000000e6ec76ac00000000cfaf497100000000b62408a300000000ac9650d800000000a5fc076f0000000091eed085000000008fca9ab9000000008e6ddc2700000000796b89b9000000007512449b0000000067a7cfb7000000005989eaeb0000000051cff8d9000000004dcc19fe000000004c8f1d8d00000000481c6a7500000000472c22f100000000437b91160000000042cbb15c000000003408e4700000000032be8f0b000000001ce9ae07000000001a0a0b3e0000000000aae33f00000000fce90be841435220616464726d70747900000000697074696f6e20656c6520646573637241646d696e20726f08c379a0000000007a65726f0000000061646472657373204d616e616765722000000002000000006520736574746572ffffffffffffffbf8000000000000000000000000000011f000016f100000432000000000101041a000000000012041b000016eb00210425000016e600210423000016e100210421000000000112022f00000000021201cf000000f901100089000000000332022f00000000043401cf00000007031001bf0000061d03000041000016b60000013d0000000006250019000016bd0000813d000000000135004b000000000016043500000000060200190000006004000039000016bf0000c13d000016bf0000213d0000000005520019000000000542016f000000200400008a0000003f023000390000000503100210000016bf0000813d000006070210009c000016990000613d0000169a0000a13d000016750000613d000016760000a13d000016520000413d000000080110008c000016510000613d00000120051000390000010002100039000016520000613d000000080220008c000016520000a13d000000070320008c0000162d0000613d0000162e0000a13d000016090000613d0000160a0000413d000015e50000613d000015e60000a13d000015c10000613d000015c20000a13d0000159e0000413d0000159d0000613d0000010005100039000000e0021000390000159e0000613d0000159e0000a13d000000060320008c0000157a0000413d000015790000613d0000157a0000613d0000157a0000a13d000015560000413d000015550000613d000015560000613d000015560000a13d000015310000613d0000004005100039000000010220008c0000150e0000413d000000060110008c0000150d0000613d000000c0021000390000150e0000613d0000150e0000a13d000000050320008c000014ea0000413d000014e90000613d000014ea0000613d000000020220008c000014ea0000a13d000014c50000613d000014c60000413d000014a20000413d000014a10000613d000014a20000613d000014a20000a13d0000147d0000613d0000147e0000a13d000000040000000500000000020a00190000143c0000013d000000000a03c01900000000040760190000000004080019000000000464013f000000000700a019000000000964004b000005c10660019700000000080740190000000008000019000000000864004b000005c107000041000000000404043300000000067600190000000506a00210000000000474001900000004070000290000000004a2004b000014570000813d000000010a100039000000020310003900000000020604330000000102100039000014350000813d000014310000013d000000010310008a0000142d0000a13d000000000541004b0000000000a50435000000000525004b000000000528004b000013de0000013d00000000080504330000000000a80435000000000575004b000000000508043300000000085900190000145a0000813d000000000587004b0000141d0000813d000000000c17004b000013f40000013d000000010a000039000000010110008a0000140d0000c13d00000000050dc019000005c10cc0009c000000000cef013f00000000050c20190000000005ef004b000005c10fa00197000005c10e600197000000000d0ca019000000000d000019000000000d6a004b000005c10c000041000000000a0b0433000000000b5a0019000000050a100210000000000a18004b0000140a0000613d000000010aa00190000013de0000c13d000000000aa0004c000000000a0b6019000000000a0c0019000005c10aa0009c000000000ada013f000000000b00a019000000000eda004b000005c10d600197000005c10aa00197000000000c0b4019000000000c000019000000000c6a004b000005c10b000041000000000a0a0433000000000a590019000013f30000813d00000005097002100000000006050433000200000005001d0000000005650019000400000006001d00000020065000390000000101300039000000000128004b0000000008060433000300000006001d000000000132004b00000000011a0019000013c20000613d000000010500003a000000010120008a0000000102100270000013ae0000c13d000000020120008c000000050330008c00000000003a04350000133e0000c13d000005c107200197000005c1063001970000000003090433000000a009100039000000050230008c0000131b0000c13d000000070130008c000000020130008c000013030000c13d0000000803000039000000000412004b000000000334013f0000000002050433000005c10310019700000000010b0433000001000ba000390000137f0000c13d000000030120008c0000000000920435000012cc0000c13d000005c107900197000000000592004b0000000009030433000000a0031000390000000502b0008c0000000002b0004c000000020440008c0000000004010433000012b30000c13d000000000706a0190000000602b0008c0000000202b0008c000013660000c13d000000070120008c0000135a0000c13d000000050120008c000012dc0000413d000000000113001900000000008a04350000124c0000c13d00000000080904330000000409000029000000060230008c000200000009001d0000121a0000c13d00000000080b04330000000002090433000000c0091000390000000902a0008c0000000602a0008c000012010000c13d000000a0041000390000000502a0008c0000000202a0008c000000020b000029000000010c00002900010000000c001d000000040330008c000011df0000c13d0000008001a00039000000040210008c000011c70000c13d000005c1083001970000010003a000390000006002a00039000000080210008c000000030210008c00000000003b0435000011aa0000c13d0000000901000039000005c104300197000005c10120019700000000020b0433000001200ba00039000000400ca00039000012e70000c13d000012830000413d000000080120008c0000126a0000413d000000060120008c000300000005001d000000010440008a0000125c0000c13d0000000104200270000011880000a13d00050000000a001d0000002005a00039000000000a0100190000006004200039000011460000813d000006050420009c0000000404000029000011410000613d000000000201043b000000000141034f000011430000c13d000000000632004b0000001f0240003900000000042400190000000003230019000005c30540009c000000000551034f0000002005200039000005c20440009c000500000004001d000000000421034f000011430000613d000000000104c0190000000001008019000005c10530019700000000040120190000005f0430008c0000061c03000041000010d80000613d000000000353019f00000000034301cf000000000343022f0000010004400089000000000545022f00000000054501cf00000003044002100000000002520019000000000353034f000000000640004c000010b50000413d000000000773034f0000000008720019000010bd0000613d0000001f0450018f00000001050000310000000303000367000010cd0000c13d000010cd0000213d000005c30640009c000000000514004b000010cd0000813d0000001101000039000010900000c13d0000107e0000c13d000000000336013f000000000736004b000005c106100197000000000531004b00000000032300490000107e0000213d000000000212034f0000107e0000613d00000000050660190000000005070019000000000558013f000000000958004b000005c1055001970000000007064019000000000754004b000000000442034f0000001f0520008a000000000213004900000000041200190000000502300210000010810000813d0000061b0300004100000000022401cf000000000424022f00000000052501cf0000000003530019000000000454034f0000103d0000613d000000000620004c000010260000413d000000000774034f0000102e0000613d0000001f0250018f0000103e0000c13d0000103e0000213d000005c30740009c0000003f015000390000103e0000813d0000061a03000041000006170300004100000ffc0000a13d000006190110009c000006180120004100000fed0000c13d000006160300004100000fd30000613d000006150300004100000fc10000613d00000fb60000c13d00000fb60000213d000005c30620009c000000000552004b0000000002350019000000000552016f000000200520008a000000000236004900000f9c0000013d00000020066000390000000000860435000000000802043300000fa40000813d000000000857004b000000400630003900000f890000813d0000003402000039000000340530003900000060051002100000001a03000039000006130300004100000614030000410000000b0000000500000f670000613d00000612040000410000000804000029000000400130003900000f5f0000813d000006040130009c00000f6a0000613d00000f130000c13d000000e001200270000005be0320019700000ebc0000013d000000e002400270000000060400002900000000022400190000000a0400002900000eed0000813d00000f500000a13d000b0000000000020000000300000005000000e00110021000000611011001970003000000000002000006100300004100000e7a0000613d0000060f0300004100000e680000613d00000e5d0000813d0000003c020000390000003c053000390000060e0500004100000e4a0000613d00000e330000413d00000e3b0000613d000000000205001900000e260000613d000000000100043300000e2a0000613d0000008004000039000000f8025002700000004004300039000000600320003900000e260000213d0000060d0340009c0000004003200039000000030500003900000e260000c13d000000410330008c000000020500003916f10da40000040f16f10db10000040f16f10dbb0000040f000000210100003900000df00000613d00000de50000613d00000dda0000613d00000dd00000613d00000dd20000813d000000050210008c0000060c030000410000060b03000041000000800110003900000022030000390000060a0300004100000609030000410000001203000039000006080300004100000d950000613d000000000474019f00000000045401cf000000000454022f0000000006630019000000000464034f00000d840000613d00000d6d0000413d000000000884034f000000000983001900000d750000613d00000005062002700000001f0520018f00000d8f0000213d000000000335004b00000d870000c13d000000010770019000000d870000213d000005c30860009c0000000107004039000000000651016f00000d870000813d000000000214004900000d180000013d0000000000740435000000010700c039000000000770004c000000000702043300000d230000813d0000006004100039000000400410003900000cfb0000013d0000000304000029000300000004001d000000000112004900000d0e0000813d000000000114004b00000000023100190000002003200039000000000131016f0000001f01300039000000000132001900000ce20000013d000000000614001900000cea0000813d00000cdb0000213d00000cdb0000613d000000000300801900000000040320190000001f0410008c00000cc20000613d000200000003001d000000000431001900000c970000613d00000c7b0000813d000006060110009c000000400310003900000c700000813d000006040310009c00000c610000c13d00000c610000213d00000c4b0000813d000000600240003900000c3d0000813d000006050240009c000000000405043300000c260000813d000006040420009c00000060041002100000000000420435000000140400003900000c0d0000813d00000000020480190000000001048019000005be0510009c000005be0400004100000bf10000613d0000060301100041000005be0540009c000000000400041400000bdf0000613d0000801002000039000000000363019f00000000033501cf000000000636022f00000000063601cf0000000004480019000000000541034f00000bc50000613d00000bad0000413d000000000768001900000bb50000613d000000010800002916f116e80000040f000200000006001d00000b850000c13d0000000104006039000000000546001900000001060000290000001202000039000005ee02000041000000b30000013d000009d60000c13d000005ef0400004100000b650000c13d000005c603000041000000000034043900000005030000390000000000410439000000000053043900000260030000390000000000730439000000000501043300000240030000390000022005000039000000000056043900000200060000390000006005000039000001e00500003900000000006504390000000406000029000001c005000039000001a005000039000000000042043900000180020000390000002004000039000000000003043900000000020704330000000307000029000001000100003916f10c070000040f00000030021000390000000000360435000a00000006001d00000020061000390000001002000039000005c503000041000005c40210009c000000e002000039000000c0020000390000001602000039000005eb0200004116f110d50000040f000000010120018f000105be0030019d0000000d040000290000800902000039000005be0310009c00000ada0000613d000005fa040000410000001403000039000005c70300004100000aef0000c13d0000000000350435000005c30530009c0000000104004039000000000443016f0000003f033000390000000000040435000000000413001900000a720000013d0000000006740019000000000514001900000a7a0000813d00000008070000290000000102200210000000f80220018f00000a650000813d00000a680000013d0000000101400210000000000221016f000000030240021000000a4f0000613d0000001503000039000005ea030000410000001603000039000005fc0300004100000aa10000c13d000000030200003900000a0a0000013d000c00000004001d00000a570000813d000000000223016f00000a490000a13d0000001f0110008c16f110460000040f16f110890000040f000000000200041616f10d380000040f16f10d2a0000040f16f10d410000040f16f10e890000040f16f10c690000040f000005ed0400004100000ae10000c13d00000a3a0000a13d000009880000013d0000000003130019000000000334001900000007040000290000000503500210000000000353004b0000000003040019000009ae0000813d000000000125004b16f10ea80000040f0000096f0000013d0000000102200039000009fb0000813d000000000221001900000000033100190000001f033000390000000002004019000000200330008c00000005022002700000001f02300039000009fb0000413d000000200130008c000005b90000c13d000000010110018f0000001f0130008c000000000301c019000000000420004c0000007f0310018f0000000101100270000100000009001d00040000000a001d000005c30110009c000000800200003916f10d110000040f000005f403000041000008610000c13d000000000332004b000000010300c039000000000341004b0000001c03000039000005c903000041000009460000c13d000008fa0000613d000008e30000413d000008eb0000613d0000090e0000c13d000000090500002900000044040000390000090e0000613d00000004023000390000002404300039000005c2022001970000000000320439000900000004001d000005f3010000410000089a0000013d000000010110003900000000022500190000083d0000813d000000000245004b000b00000004001d000005ff01000041000900000005001d0000000b060000290000000705000029000005f6040000410000000303000039000005f5011001c70000000003018019000d00000005001d0000004002400039000005c40240009c000008a90000c13d00000000030004110000000002000412000600000005001d16f10d310000040f16f10c530000040f00000020025000390000000005006019000000000140004c0000000000150435000001000200008a000008950000c13d000000200530003916f116c70000040f000009440000c13d000000000232004b16f10d4a0000040f0000001003000039000005ca03000041000008fc0000c13d000600000002001d00000160020000390000000002270019000800000007001d0000800a01000039000005e701000041000006c60000013d0000081f0000613d000c00000005001d000006f90000613d000000000243001900000000026201cf000000000262022f0000010006600089000000000767022f00000000076701cf000000000705043300000003066002100000000005530019000000000252034f000006ee0000613d0000001f0640018f000006d60000413d000000000772034f000006de0000613d00000005054002700000000202500367000008150000813d00000000010004100000000e03000039000005f7030000410000084a0000c13d000000000130004c0000000401100370000000240210037000000000005104390000800201000039000005f801000041000005fe010000410000002201000039000008320000613d000000000331013f00000001030020390000001f0340008c000000000403c0190000007f0430018f00000001031002700000000000310439000005030000013d000000010200c039000d00000006001d000005330000613d000000040520008c00000001060000390000000001430019000000000161019f00000000015101cf000000000151022f000000000656022f00000000065601cf0000000006020433000000000121034f000005280000613d0000001f0540018f000005100000413d0000000007630019000005180000613d0000000502400270000009390000813d000400000008001d000700000007001d0000000001070019000000000141019f00000000011201cf000000000212022f000000000414022f00000000041401cf0000000003380019000000000232034f0000000503300210000004fa0000613d000004e30000413d000000000552034f00000000065800190000000505400210000004eb0000613d00000020082000390000001f0130018f00000000007204350000003f013000390000000503700210000005c30170009c00000601010000410000060204000041000000000223019f000000e0033002100000000703000029000700000004001d000005c40120009c000005e80200004100080000000c001d00070000000b001d000005c30510009c0000007f01a000390000000001a10019000000000026043500000000025201cf000000000252022f000000000262034f000003690000613d000003520000413d000000000882034f00000000098100190000035a0000613d0000000506a002700000006001400039000000000c020019000000000b0100190000001f05a0018f000000090a0000290000000c05000029000000400340003900000084010000390000006401100370000c00000003001d0000004403100370000000a00410008c00000020023000390000001001000039000005c502000041000005f00300004100000b410000c13d00000000010460190000000001050019000000000116013f000000000512004b0000000001310049000005c30230009c000000000302043b000000000443001900000000040560190000000004060019000000000447013f000000000847004b000000000643004b000000000332034f0000001f0420008a000009f00000c13d000000010110008c000009810000813d00000000020c043300010000000a001d0000000003c2004b00000000022c00190000011b02b00039000000dc02b00039000000bc02200039000000a80520003900000060047002100000000002b10019000000000262019f00000000022501cf000000000626022f00000000062601cf0000000004640019000000000565034f000002850000613d000000000820004c00000000070004110000026d0000413d000000000885034f0000000009840019000002750000613d0000000506b002700000000205500367000000c804c000390000001f02b0018f000000080b0000290000002001c000390000006801c000390000008801c00039000000a801c000390000005404c00039000000600110021000000000030004160000004001c00039000000000502043b0000000202a00367000000440a0000390000006004200210000000030c0000290000000000300439000005e803000041000000a4010000390000008401100370000500000003001d0000006403100370000000000630004c000000c00530008c000000040320008a000005e801000041000005fd0300004100000a1c0000c13d00000000040300190000000104500190000000000441004b000008da0000613d00000004040000390000015b0000613d000000040420008c000005f901000041000005c20110009c0000012d0000013d0000000205200367000009790000813d000000000532004b00000024022000390000000a06000029000000000615004b0000000005510019000000000551016f0000003f01400039000005c30130009c000000000113034f0000000001056019000000000714004b000000230420003900000004023003700000000002036019000000200420008c000000040210008a000000e40000013d00000000063400190000000005740019000007fc0000813d000000000524004b0000002007400039000000000445004b000000000532001900000140033000390000000000280435000b00000008001d00000000005a0435000000000685004b000000000558001900000000080a04330000000005b5016f0000003f05200039000005c30520009c0000012002300039000000000642004b0000013f0230003900000120042000390000014003000039000000b60000a13d000005c20310009c0000000001090433000000000103c019000000000100a0190000000003014019000000600320008c000000000151019f00000000011301cf000000000313022f000000000515022f00000000051501cf0000012004400039000000000343034f000000a50000613d0000008e0000413d00000000007604350000012006600039000000000763034f000000960000613d00000005042002700000001f0120018f00000000001a0435000000870000213d000005c00330009c000005bf031000410000000001b1016f000000200b00008a0000013f0120003900000000009a0435000000400a0000390000012009000039000005e60130009c000007d60000613d000005e50130009c0000079b0000613d000005e40130009c000001f60000613d000005e30430009c0000074b0000613d000005e20430009c0000070c0000613d000005e10430009c000006b70000613d000005e00430009c000006860000613d000005df0430009c0000065f0000613d000005de0430009c0000062d0000613d000005dd0430009c000001ce0000613d000005dc0430009c000001af0000613d000005db0430009c000006090000613d000005da0430009c000001820000613d000005d90430009c000005e00000613d000005d80430009c000001350000613d000005d70430009c000005c10000613d000005d60430009c000005980000613d000005d50430009c000005740000613d000005d40430009c000005510000613d000005d30430009c000004bf0000613d000005d20430009c000004a00000613d000005d10430009c000004810000613d000005d00430009c000004220000613d000005cf0430009c000003fe0000613d000005ce0430009c000003120000613d000005cd0430009c000000ec0000613d000005cc0430009c000002ea0000613d000005cb0430009c000000e0033002700000008005000039000000720000c13d000100000000001f000005be0030019d00020000000103550003000000410355000005be04300197000e00000000000202cf07cd008202ce07cc07cb07ca07c907c8008107c707c6005401b400e500b901b301b20133013207c507c407c307c207c107c007bf07be07bd07bc07bb07ba07b907b807b707b607b507b407b307b207b107b007af07ae07ad07ac07ab07aa07a907a807a707a607a507a407a307a207a107a0079f079e079d079c079b079a0799079807970796079507940793079207910790078f078e000a00190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b702cd000f00b700b600b5004c002300430013000d00090016078d078c078b00190008000a00b9078a078907880787078607850011000b004b000e0003000f000100050784078302cc078200e40781001d00e307800130077f077e00b4012f077d01b1077c012e077b01b0077a01af07790778005f02cb077707760775008002ca07740009077302c900e4077201ae07710008000a0770076f076e0001001e0005076d02c8006901ad0053076c076b0068076a002f012d02c701ac02c6012c02c501ab02c402c3005a000a0769002b0768004f07670766076507640763002f012b01aa004f012a007f076207610760075f075e075d005301a9075c004e075b075a075907580129012800e2075700190008000a0127075600e10755004e02c201ac01a8012601ab00b30754005a000a02cc0753005701a700530752006801a6002f012d001b01a50751012c02c1001802c007500008000a00b2074f0132074e004f0125074d01a4074c00140007074b074a002f012b01aa004f012a007f074901a302bf074802be02bd02bc0053012407470746074500e000e200df00b1074400190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d001707430053001400670742004300b0001a07410740073f009201a201a1005d0008073e00de02bb012301a002ba02b902b8073d001d019f019e004f073c007f073b00660043019d01b2007e007d02b70053004a005a073a003407390002003302b60002002e000c003200490002002d000500190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d000b007c0013000300010012001000220012002b0037002a007d00480042002a00550122002000af00230047000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700170738005800ae000e004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d001701210020007b000b02b500130037000300010012001000220012002b0003005c001a00090016073700910736001d019c0120073500dd009000dc00ad00ac000a02b4005f02b302b200530734005f00ab02b1005f07330732004d011f005300db019b0051019a07310052004d02b0005300b900db02af0730072f00aa00da00ae008f000e0199004c02ae001a007a000102ad02ac00a9000b00d9001302ab00030001001200100079006500780003000100120010002202aa001a007a000100d802a90014000700d702a800580077011e004c072e02a7072d072c072b072a002a07290728007600a9072707260080072500d60076072400e5072302a600760722000c07210720071f01a2071e071d011d071c001f0198071b071a0197011c00d501960719071807170716019507150714019402a50713071200e002a402a3071107100064070f070e070d0031070c0002070b0193070a00d402a207090708000902a101a7004f011b007f07070066004107060010008f011a00550059011902a0001a0192019100d300a8029f0705070407030127011800470702029e0701005f00680700002f012d01a500d206ff012c06fe01ae06fd06fc00a7000a01a906fb019006fa06f9005306f80117009106f7001d029d001b0116029c029b06f6001806f506f40008000a0077029a000806f300140007003406f20002003302990002002e000c003200a60002002d000500190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700510298005d011506f1000c06f00043000d0012008e00ab0013004106ef018f00230047000d0009001600190008000a00b9029700e106ee004e02c2001b01b101260018011402960008000a013302b4005f00ab02b2005306ed005f009202b1005f06ec06eb004d011f005300db019b00aa029506ea0052004d02b0005300b900db019b0066018e06e901a2018d029406e8018d06e706e606e506e406e30072011306e2011d06e1001f019806e006df0197011c00d5019606de029306dd019506dc0292018c02910290028f0057018b06db06da028e06d906d8018a028d008006d7028c0112028b028a001e011106d6004f00a5007f00120003007e000d06d506d4001002890110011a007100590119002a00a90288008d005c028700200059018902860001028502840020008c028306d30282001700ae000e004c02ae004a007a000102ad02ac011a00700075011902a0001a0065008b004900da01880041008f000100120010002202aa004a007a000100d802a90014001506d2004f0281019a00120003004800750042004a0192007d0187028006d10064008f00430020000b00a8007200030001001200100059002b027f06d0006906cf06ce0082005c00a40063001400070040005d00020075000c010f010e010d0186008a010c006f010b006200d100a3018506cd010a00890081010900140007001a000c00130009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b70108027e00b600b5004c01840020000c00130009001600190008000a002900280027005e00090026001b002100250018000d00240008000a0056018300570065001300370003000100120010002200510182000100a2027d027c000b00d9001a0003000100120010004a0065001a0003000100120010004a0065008b0023004100170001001200100051002000220088005500220181027b0092027a00370107002a027900480042005d00d6027800b30277007d00170180000100a20106001400070088001a005d00af00a10047000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001702a8005800ae000e004c002300430013000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001706cc005800ae000e004c002300430013000d0009001600190008000a01270276008f027506cb004f06ca06c9028c01120012002b0061019a017f001e0111019e004f00a5007f00120003005906c806c706c600b901130274027306c5004e06c406c306c200e001a3017e017d06c1002106c006bf06be06bd01b0018e06bc06bb005702cb06ba06b906b8004306b706b606b50272011e0110005000a00009027106b4007700ab017c00660069017b005206b301a806b2001d00e306b102700105010400b4026f06b006af00d006ae010306ad026e018c06ac06ab06aa004d018b06a906a806a7000306a6018a06a500b002a706a406a3001d002f026d026c06a200a90007001a010200cf01030004026b026a0088017a0023008c00030087000700ce00cf007400720061004a005a001e06a1000c00cd011e06a000190008000a002900280027005e00090026001b002100250018000d00240008000a005601830057006500130037000300010012001000220012002b0003005c001a0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00660101001700b800580131000e00b70108069f00b600b5004c01840020000c00130009001600190008000a002900280027006a00090026001b002100250018000d00240008000a001400070088000100220269069e069d01a8069c069b0009069a0699011b06980011000b0697000e0003000f0001000500190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700170696005800ae000e004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a005600170052004d00510121069500580020004a01000694000f004c0012008e0008000100a200430013000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b70108069300b600b5004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a00560051005201320012026800aa004000da000200130037000c02980070001500a80010000b0020004a000c00010012001000220012002b0003005c001a0009001600190008000a002900280027026700090026001b002100250018000d00240008000a013306920057069101320690068f001400070034068e00020033068d0002002e000c003200490002002d000500190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d000b007c00130003000100120010002200510266000100d801060014000700170048004a0042002a00550122002000af00230047000d0009001600190008000a0127027600cc005c008d0272008f00500110068c00aa000900590271068b007100ab017c006600690265017b00b0068a068900d00688002f0179026406870130017800ff00fe06860685011d068401770683068206810680067f067e0057067d067c067b028e009f067a00fd0263007200cb06790072001d002f026d026500770007002300ce00cf026200fc006100510678017a004a0003008c005a0677002300cd067600190008000a002900280027005e00090026001b002100250018000d00240008000a0056018300570065001300370003000100120010002200510182000100a2027d0055000b007c001a0003000100120010002200510266000100d801060014000700170048004a0042002a00550122002000af00230047000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a027c000b00d9001300370003000100120010000e011300570065001a0003000100120010008b0023004100170001001200100051002000220088005500220181027b0092027a00370107002a027900480042005d00d6027800b30277007d00170180000100a20106001400070088001a005d00af00a10047000d0009001600190008000a002900280027026700090026001b002100250018000d00240008000a00560052004d001701210020007b000b00d9001300370003000100120010000f011300570065001a000300010012001000220012002b0037002a007d00480042002a00550122002000af00230047000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a005600170052004d00510121067500580020004a01000674000f004c0012008e00430013000d000900160673067200fd06710670002b019902b700530261066f009e0034066e00020033066d0002002e000c003200490002002d00050014000700170075066c00230047000d000900160075002b0023066b00cf0015009d066a00140015003700ca000300b2066900230047000d000500a100c90668005a06670666011206650664017606630662000d0661001400070017008c066000230047000d0009001601880199065f00b80058065e00560017007d0100010800120088010000b600b5004c00120030007b065d00fb065c0020017600df01750072000c065b004f065a06590260009f007e01740010000b0020004a0003000100120010002a007100630087007b0012002b000300fa010e010d065800f901a0006f010b0062065700a306560655065406530089008101090001001e000900160652065100f8001d0650064f064e025f00510022010a01a900a10075064d00030055025e064c064b064a008000b000d300b800a00058001a005500b700a8027e00b600d700b502ab01740649004c00790282001a005d064800fc00a1025d005101730078004c00c80059064706460064064500030055018401b3064406430172064201a100c800080641025c025b017100140007017000e40640001d00e3025a02590105010400b4012f063f016f063e012e019000c7016e01af0258016d0057016c02570256016b006400de000501180086005a063d009e0034063c00020033063b0002002e000c003200490002002d000500de02bb012301a002ba02b902b8063a000902a1019e004f011b007f00660043019d01b20075002b009d000906390638000a005a0124001a018706370034063600020033016a0002002e000c003200490002002d000500140007001700590255063500230047000d0009001600500005063401910003010100a00633004f0169063206310001002202690630062f062e062d062c000100d8062b007a062a00ab0629062800f800130001001000f706270626062506240023062302740622009206210055007a062000010037001a0063001a061f061e061d0012008e00430013000d000900160168008c008d005000cc0009001d061c061b0092007000dc025f017c0082017b007700a4061a029a010a01870069061900cf06180617061600410008000100a2005d061500b4008c06140011000b002c000e0003000f00010005025400fb0613008702530012002b00370079007a06120048009c004200d6011702520002008000c60052025100fa016701660250024f0165006f0164006200d100a3024e0611024d024c00890081010906100017009c060f00200050005b000c00a9060e0079060d001a024b00a9060c00170022060b060a001a00630001001e0009001600140015003700ca000300b2060900230047000d000500040608060700f80013003700010010009c00f70606024a001a012400090014009200fb00700037006106050007060400b30063005d0249001a00b10181017e06030020000b0602012300aa0295000c006e000100da0010002201b40008060100a80007003406000002003305ff0002002e000c003201180002002d000500140007003405fe0002003305fd0002002e000c003200a60002002d000500040008000105fc0087000702a605fb02480247024605fa05f905f800790066010705f70079019405f60248024702460007011200b30063007c007905f50062001e006300700067007400150163004e05f4017d05f305f205f10129012800e205f005ef05ee000205ed016205ec02be02bc004e05eb05ea00c5004f0245007f05e9002b00100244003700030071028605e800740007003405e70002003305e60002002e000c003200490002002d00050020000b00700075000c0001008c0010002a0001006300a80007004000660002004a000c010f010e010d0186008a010c006f010b006200d100a3018505e5010a008900810109007c001700b0004a00cb05e4010f05e3010c00f6024305e2006605e1001d0089008202ce05e0016105df0017017a002005de0001001e000900160020024205dd0041024105dc0041002e000c024000780041002d000505db007d00710003023f05da00da000300550007007b023f00aa00c5016005d9015f004f006d009f004005d8000205d7000c0160008d05d605d505d4000c05d300fd05d20087001500140010002a0070023e002a05d1000c05d005cf00c805ce0255025d001a008e05cd05cc05cb05ca015e005d006905c905c805c705c6015e00a1006905c505c405c305c2015e05c105c005bf05be05bd05bc05bb015f05ba05b900160014000700170004010205b80048009c004200d6011702520002008000c60052025100fa016701660250024f0165006f0164006200d100a3024e05b7024d024c0089008105b605b50020024205b40041024105b30041002e000c024000780041002d0005015d015c023d023c023b023a0239023802370236008a023500f6015b015a05b202340009012505b10233009b003100cd0273004e05b0024505af016102320231005c01590006015805ae015c023d023c023b023a0239023802370236008a023500f6015b05ad05ac01620171017000e405ab001d00e305aa02700105010400b4012f05a90234016f05a8012e05a705a6016e02a505a505a400e0016c016d05a305a200f5016102320231005c015700060230008a022f006f00f9015600f40062016700f9015601640062024305a1015a00a505a0004d00060001001e0005008200fa059f059e016500f600f40061059d00a4015a00a5059c004d00060001001e0005059b059a0599006f00c40166059800f4026a022e023000f90156008a022f006f00f40062022d022c0597022b006e000300060011000b004b000e0003000f0001000500c300860596059505940163007605930592022a00c9002b00100244002b023e00060011000b004b000e0003000f000100050082022905910228000c00df017502bf0590058f058e009f007e001000060011000b004b000e0003000f00010005022c058d022b006e000300060011000b004b000e0003000f00010005022700d402a20061017f001e0111011f058c00a5058b006e000300060011000b004b000e0003000f00010005006e0268058a05890588000200060011000b004b000e0003000f000100050587058600060001001e0005022600910155001d019c01160120022500dd0224009000dc00ad00ac05850223005f01ad0222005005840221022200a400060001001e000501580583015400480042009c0192015f029400410080022801570006022600910155001d019c01160120022500dd0224009000dc00ad00ac05820223005f01ad02200125005000c70221022000a400060001001e0005002a029700e10581004e0580001b01b1057f0018011402960008057e00560052004d011f057d00db02af00060001001e00050067000200b1004e017d057c021f00e2057b01290128057a0579018a057800d4057700610006015300a000070003057600d300c20575021e004e01720574057300c6057200430004005000a00007021d0571018f057000a6017e0249002a056f005c0152000600c100760151056e00df056d002f00fe056c00b1056b056a001f0569056800ff00e2056705660050000c000d00b3021c0006006500130003006e000100100006021b0013000c0040000d018f0006007b000b02b500130003006e000100100006007b000b00d900130003006e000100100006021b0013000c0040000d021c0006012401500565021a01a40564022901600292029c001f0563056205610560055f0128000c021f055e055d055c02190218055b011d055a001f0198055905580197011c00d50196055702930556019505550554018c02910290028f009b018b0553055205510217026e00fd00060011000b004b000e0003000f000100050001001e0005000805500006005400070034054f00020033054e0002002e000c003200490002002d000500c0054d0002006d054c00020040054b00020013000c054a0006006d054900020040021600020013000c00f30006006d05480002004002b600020013000c00f30006015d054705460182054502150544029f0543009a0542015900060011000b0541000e0003000f0001000500540015009900ca000300b20540014f0047000d000500540015009900ca000300b2053f014f0047000d000500540015009900ca000300b2053e014f0047000d00050158053d008e053c0009053b053a0539018e0538000905370536021400b1002b00c3021e00690213021705350064053402800064004300f800b0008b05330212001d01a100080532053102610009014e05300082001d000d052f01570006025c025b017100c60007017000e4052e001d00e3025a02590105010400b4012f052d016f052c012e019000c7016e01af0258016d0057016c02570256016b006400de0005002a00c1014d0115052b00e5052a009f0529004102110528021000640086001000060011000b004b000e0003000f0001000500080527000600540007003405260002003302990002002e000c003200490002002d0005000805250006005400070034052400020033020f0002002e000c003200490002002d0005015d01540048004200bf0003015900060523021200d7002b0099002200bf027f00990522020e005b0063017200500007052100bf020e005b006305200006051f008f00070215051e00a00168008d0004016800cc007c00d70123020d005400d3004801540009000400fb051d0077000700ce014c026200400077024a00610007000b0074005b000c0001009c01880010002200820087000700720102014c00c600a402b3004201180059051c051b051a00030071000700ce014c0071001200610519000c00cd05180087020c002a0048004201100071020c008d0077025301b4000b0074005b000c006e0001026b0010002200590517002a051602c800ce0515004800cc0042008d007100fc00420059007a05140072008e0513051205110003004800fc017400420510011700c8000200cc00800014000b0074005b000c0001007200100059024b00700007004000c80002011e000c010f010e010d0186008a010c006f010b006200d100a30185050f026000890081050e0014050d00060011000b002c000e0003000f00010005005400070034050c0002003302160002002e000c003200490002002d00050011000b004b000e0003000f000100050001001e0005007000070034050b00020033050a0002002e000c003200a60002002d0005050900c1014d011500e50508009f0507004102110506021000640086001000060011000b004b000e0003000f00010005002a00c1014d0115017600e50151050501a30213001f0504050300b10502050100d5050004ff04fe04fd018d022701a404fc04fb04fa001d019f04f904f8020b04f700640086001000060011000b004b000e0003000f00010005000804f6000600540007003404f500020033020a0002002e000c003200490002002d0005000804f4000600540007003404f300020033020f0002002e000c003200490002002d00050015019d04f20050001504f104f004ef00480042000600540007003404ee0002003302090002002e000c003200490002002d000500540007003404ed0002003302090002002e000c003200490002002d0005002a015004ec020804eb00d4020700c3010100c701a6002f012b04ea04e9012a04e800c9000c04e7021802bd0219020600d004e6002f0179026404e50130017800ff00fe04e404e304e2017704e104e00194021404df02a3009b02a404de04dd016b004100060011000b004b000e0003000f00010005006d04dc00020040016a00020013000c00f30006010704db04da04d9011a04d804d7029e04d6009b003604d5001f04d404d3003504d2020504d1009804d004cf008504ce028b04cd005701a704cc04cb0050009104ca001d029d012004c904c8029b04c7009000dc00ad00ac04c600060001001e00050011000b002c000e0003000f000100050061017f001e011100a504c500060011000b04c4000e0003000f0001000502cd00de009d0204015004c3021a00d4020700c3010100c704c2001d019f04c104c0020b04bf00c9000c004004be04bd04bc020600d004bb002f017904ba04b90130017800ff00fe04b804b70204017704b604b504b4015104b304b2005f04b104b004af04ae000200060011000b004b000e0003000f00010005000804ad000600540007003404ac00020033020a0002002e000c003200490002002d0005015300d302ca04ab004e04aa04a900d004a8009804a7000804a6013304a5009b04a404a30203022a023304a204a100e00097009b04a00203049f049e049d0068049c002f012d01ac00d202c6012c02c501ab02c402c3005a049b049a04990175011900d7000400780283002a01730007000800010498009900c30086028104970076000201630162007604960495049400c9002b00100289005b0288020d005c02870074007b00790102000102850284007c00bf015200060001001e00050011000b004b000e0003000f000100050153049300be0202049204910490048f0081048e00970201048d02630060001e048c014b00f700690200009601ff0096010300a601fe00c200c4002b01fd014a0090000900ad01fc01fb01fa000701f9009801f801f701f601f500bd008501f401f300f201f201f100f2018901f001ef00c40149048b0191048a0489048802020487048604850484048301ee0482006801a6002f01ed02c101ec004e01eb001801ea048100a70480047f009e0148001c0193009e047e001c047d001c047c0030047b021d0069006801e9002f00f102c7047a00bc00f000ef00ee00ed0085047900740076009e009a001c0002009e0478001c01e8001c0477006701e7007e00680147002f00f100d2014600bc00f000ef00ee00ed0085047600f501450475001c000c006001690474008404730472000401e60471001c0470001c01ee046f007e00680147002f00f100d2014600bc00f000ef00ee00ed0085046e00f5006701e5001c019301e6046d001c046c001c046b046a046900e101e4004e01e301e201e101e0012601df0098014400ac046801de001500bb001c011c046700ba00040143000401dd000401dc000400ec000400840004006c000400eb00040143000400950004009401db000400670466001c01da001c00be0465046400e101e4004e01e301e201e101e0012601df0098014400ac046301d9001500bb001c046201d80004006b00040083000400ea000401dc000400730004008400e9005b00e802010060001e001d014b00f7008601d7009600c2046100500007014901b30460045f045e0060006b0004008300040094000400ba00040095000400ec0004006c000400730004006b00e9005b00e80097045d045c0060006b00040083000400ea000400ba000401d8000400eb000401dd000401d6045b001c045a001c006d003000e7003f0036003e001f04590035003d003c0205003b003a003900380458003104570456001c000201d6045501420454001c0078002b0453045200910451001d01d50116045001d400dd01d301d201d100a7044f00410015005a01420078044e01d0000400ec00040095000400940004006c000400730004008400e9005b00e8044d044c0060006c0004006b0004006c005b00e900e8044b044a04490097044802c9006801e9002f01ed04470446004e01eb009001ea044500a7044401de00be005a01420078000301450443001c0442001c028d006701e7007e00680147002f00f100d2014600bc00f000ef00ee00ed0085044100f5014501e5001c000c0060016901d000040083000400ec01db000400670440001c01da001c043f043e00be00910155001d01d5043d043c01d400dd01d301d201d100a7043b043a00670439001c01d9006b000400ea0004006c000400730004008400040143000400eb000400950004006b00040083000400ea000400730004008400040083014100970060006c0004007300040094000400ba0004006b01410060006c000400730004008400040094000400eb0004009400040095000400ba00040095000400830004006b0004007301410438043700970060006c000400670173043604350200009601ff0096010300a601fe00c200c4002b01fd014a0090000900ad01fc01fb01fa000701f9009801f801f701f601f5043401f401f300f201f201f100f2018901f001ef00c4014901800433025400be01d7009600c2043200500007015200060011000b002c000e0003000f000100050011000b007c000e0003000f0001000502cf026c04310114014001cf015c0430042f042e0093042d00bd042c0208042b042a04290428027500d500bc0427042600c5042504240423042204210420041f041e041d041c041b041a041904180417041601400415041404130093041200c504110410040f040e040d040c040b040a0409001d040804070406040500850404040304020401040003ff03fe03fd00c503fc03fb01ce00bd013f03fa009303f900bd03f803f703f60093014e013f01ce00bd013f03f50093014e03f403f303f203f1013e03f0028a013e03ef03ee02c0001d014b013e00bf005a014001cf03ed03ec03eb01ec03ea03e90093012503e803e703e603e5012903e403e303e203e103e003df01a503de03dd03dc01ae03db03da00a703d900cd03d803d703d600060011000b002c000e0003000f00010005001500e603d500bb01cd00c0003000e7003f0036003e001f00460035003d003c0045003b003a0039003803d400310007009a01cd000200060011000b002c000e0003000f00010005001501cc03d300cb03d201cb003001ca003f0036003e001f00460035003d003c0045003b003a0039003803d10031000701c903d0000200060011000b002c000e0003000f000100050015009d01c800cb03cf00400030013d003f0036003e001f00460035003d003c0045003b003a0039003803ce00310007000801c8000200060011000b002c000e0003000f00010005001501c703cd03cc03cb006d003001c6003f0036003e001f00460035003d003c0045003b003a0039003803ca00310007014803c9000200060011000b002c000e0003000f00010005001503c803c700bb03c603c50030013c003f0036003e001f00460035003d003c0045003b003a0039003803c40031000703c303c2000200060011000b002c000e0003000f000100050015009d013b03c1013b0040003003c0003f0036003e001f00460035003d003c0045003b003a0039003803bf003100070008013b000200060011000b002c000e0003000f00010005001500e603be01c503bd00c00030013d003f0036003e001f00460035003d003c0045003b003a0039003803bc00310007009a03bb000200060011000b002c000e0003000f00010005001501c403ba01c303b901c2003000e7003f0036003e001f00460035003d003c0045003b003a0039003803b80031000701c103b7000200060011000b002c000e0003000f00010005001503b603b5013a03b403b3003003b2003f0036003e001f00460035003d003c0045003b003a0039003803b10031000701e803b0000200060011000b002c000e0003000f00010005001501cc03af00bb01c001cb003000e7003f0036003e001f00460035003d003c0045003b003a0039003803ae0031000701c901c0000200060011000b002c000e0003000f00010005001500e603ad01c301bf00c0003001ca003f0036003e001f00460035003d003c0045003b003a0039003803ac00310007009a01bf000200060011000b002c000e0003000f000100050015009d01be01c503ab0040003001c6003f0036003e001f00460035003d003c0045003b003a0039003803aa00310007000801be000200060011000b002c000e0003000f00010005001500e603a9013a01bd00c00030013c003f0036003e001f00460035003d003c0045003b003a0039003803a800310007009a01bd000200060011000b002c000e0003000f00010005001503a703a603a503a403a3003003a2003f0036003e001f00460035003d003c0045003b003a0039003803a10031000703a0039f000200060011000b002c000e0003000f00010005001501c7039e00cb01bc006d0030013d003f0036003e001f00460035003d003c0045003b003a00390038039d00310007014801bc000200060011000b002c000e0003000f00010005001501c4039c013a01bb01c20030013c003f0036003e001f00460035003d003c0045003b003a00390038039b0031000701c101bb000200060011000b002c000e0003000f00010005039a0399039803970396039500c1007e0394026f002f012b01aa0393012a039200df03910390001d038f038e038d025e038c0114038b005c00060011000b004b000e0003000f00010005006d038a00020040016a00020013000c00f3000601b00389014a03880387011b00090144038603850384015b00060383008b0006001e00060382008b0006001e00060381008b0006001e000603800006037f0006037e022e022d000000000000000000000000000001390044004400440000004400440044037d037c00000000000000000139004400440000000000000044000000000000037b0138037a000000000379000000000000037803770376000003750000000000000374037303720371037001ba00000000000000000000036f000000000000036e000000000000036d000000000000036c000000000000036b000000000000036a0000000000000369000000000000036800000000000003670000000000000366000000000000036500000000000003640000000000000363000000000000036200000000000003610000000000000360000000000000035f000000000000035e000000000000035d000000000000035c000000000000035b000000000000035a0000000000000359000000000000035800000000000003570000000000000356000000000000035500000000000003540353035203510350034f034e034d034c034b034a03490348034703460345000001b9034403430000013700000342000003410340033f033e033d033c01b80000033b033a033903380337033603350000013900440044004403340333033203310330000000000000032f032e032d032c01370000032b0000032a032903280327013801b7000000000326032503240323032200000000000003210320031f031e0137000000000000031d031c01b70000031b031a01ba00000319031803170316031503140313031203110000000000000310030f030e030d030c030b030a0309030800000000000000000000000003070000000000000306000003050000000000000000030400000303030201b800000301000000000000013601350134030001360135013402ff013601350134000002fe004402fd02fc02fb02fa02f902f8013802f702f6000002f502f402f302f202f100000000000002f002ef02ee02ed01b601b501b902ec02eb02ea02e902e802e702e602e5000001b601b502e402e302e202e102e0000002df00000000000002de00440044004402dd02dc02db000002da02d902d802d702d602d502d4000002d302d202d102d0000000000000000000000000000000000000000000000000000000000000", - "logIndex": 2, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x0000000000000000000000000000000000008004", - "topics": [ - "0xc94722ff13eacf53547c4741dab5228353a05938ffcdd5d4a2d533ae0e618287", - "0x0100061f04f8ac19b027b4df36f13d2566f46cbfd1a9e0a6669dbb2e33877e0f", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 3, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0100061f04f8ac19b027b4df36f13d2566f46cbfd1a9e0a6669dbb2e33877e0f", - "0x0000000000000000000000009104356bb320ab72fffbdcfe979577fc78377821" - ], - "data": "0x", - "logIndex": 4, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - }, - { - "transactionIndex": 0, - "blockNumber": 3197340, - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x00000000000000000000000000000000000000000000000000494f95f3453b80", - "logIndex": 5, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792 - } - ], - "blockNumber": 3197340, - "confirmations": 799, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0ee6b280" }, - "status": 1, - "type": 113, - "l1BatchNumber": 33792, - "l1BatchTxIndex": 240, - "l2ToL1Logs": [ - { - "blockNumber": 3197340, - "blockHash": "0xfb393e0778fb461c9c52973961862de7359baa6729d050b2784afad9d6cca7aa", - "l1BatchNumber": 33792, - "transactionIndex": 0, - "shardId": 0, - "isService": true, - "sender": "0x0000000000000000000000000000000000008008", - "key": "0x000000000000000000000000000000000000000000000000000000000000800e", - "value": "0x3bb7506038cd0b0f3ca1d4115458116a3836ebff61fc8355f338d42b0a5be957", - "transactionHash": "0xd6906d54b755e30aec4868231fae2b9fe146fdfc78b8d6cf6b96203b59fda4ac", - "logIndex": 0 - } - ], - "byzantium": true - }, - "args": [ - "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "Api3ServerV1 admin", - "0xD6A26d7612c2781b380e13Cf542d846F9A360BD7" - ] -} diff --git a/deployments/zksync-goerli-testnet/ProxyFactory.json b/deployments/zksync-goerli-testnet/ProxyFactory.json deleted file mode 100644 index 13aebc10..00000000 --- a/deployments/zksync-goerli-testnet/ProxyFactory.json +++ /dev/null @@ -1,483 +0,0 @@ -{ - "address": "0xb9ed9a0Ecfcc544D8eB82BeeBE79B03e13012d7c", - "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": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xb9ed9a0Ecfcc544D8eB82BeeBE79B03e13012d7c", - "transactionIndex": 1, - "root": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "gasUsed": { "type": "BigNumber", "hex": "0x1148e68b" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x00000000000000000000000000000000000000000000000001aa9f0399760f60", - "logIndex": 9, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - }, - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x0000000000000000000000000000000000000000000000000096038ed15322e0", - "logIndex": 10, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - }, - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x0000000000000000000000000000000000008008", - "topics": [ - "0x3a36e47291f4201faf137fab081d92295bce2d53be2c6ca68ba82c7faa9ce241", - "0x000000000000000000000000000000000000000000000000000000000000800e", - "0x9fd7af3b8cde88e76e27fe4a2a0f609dab94072dd3f81d78ec3e5e2e8b3fef20" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000020f202790000000000000000000000000032043500000000010000190000000002010433000000000012043505f6046f0000040f000000000110004c000000000001042d05f604cb0000040f00000000002104350000046c0000c13d0000017f0420009c00000007010000290000018101100197000000010100c039000000000112019f00000000020380190000002001100039000000080100002900000000020000190000000000230435000000000210004c05f604c10000040f000000040200003900000000030000190000000001000416000000000104001900000006010000290000002003000039000000240200003905f604860000040f0000000001000031000000000014043500000000001304350000000803000029000000070200002905f6057e0000040f0000000003000031000800000003001d000000000101043300000020020000390000000001030019000000000301001905f605ec0000040f00000194011001c7000000000200041400000000010380190000017f0410009c0000017f03000041000000000871001900000020032000390000004f0000213d0000000503000029000400000001001d000700000003001d0000000802000029000600000002001d0000010003300089000000000404043b0000000303300210000000200300008a0000000000010439000000000101043b000000c002200210000000400220021000000002044003670000000403000029000700000002001d0000002002400039000500000001001d000500000003001d00000000033401cf000000000434022f000000000630004c000000010660003900000005076002100000000006000019000000410100003900000000001004350000019b0100004100000024010000390000000000120439000000000100041200000000001004390000018e0100004100000000005304350000000101200190000000000303043b0000000102200190000100000003001d0000046c0000613d000700000005001d00000003030000390000800d020000390000006001100210000000000131016f000000000001043500000000019100190000000007a6004b0000000000780435000000000707043b000000000774034f0000000006a0004c000000050a900270000000400120003900000181051001970000001f0390018f00000000009304350000000002050433000000080500002905f604950000040f0000002401200039000001930120009c05f6053a0000040f000600000004001d00000006040000290000000002010019000000050100002905f605d10000040f05f605130000040f000000000202043305f6054c0000040f0000019001000041000000a001000039000000a0024000390000008003400039000000600240003900000040034000390000000004030433000000000200041005f605680000040f0000000000020439000000000023043900000004030000390000000002000412000000000020043900000000030304330000018e020000410000000401000029000000030100002905f605bf0000040f000700000001001d05f604f00000040f0000006402000039000000040210003900000184020000410000002402100039000000440210003900000000020400190000004001000039ffffffffffffffff0000004002000039000000600220021000000040011002100000000007610019000000000464034f0000000002030019000200000002001d000003f30000613d0000008403400039000000a4024000390000000304000029000300000001001d000300000003001d0000000602000029000400000004001d000000040400002900000007030000290000000502000029000000000302043300000000040000190000018003000041000000000363019f000000000636022f00000000063601cf000001800110009c00000180011001976f0000000000000000000000ffffffff000000010200003900000000070000190000019e0310009c000005370000213d000000000402001905f604d40000040f000000040110003900000000010360190000000003008019000000000510004c0000000004032019000000040120008a000004ed0000213d000005f800010430000005f70001042e000000c0011002100000017f0320009c0000017f0100004105f605f10000040f0000000000310439000000000500001900000000010504330000000706000029000000000037043500000000060704330000000506a0021000000005040000290000000609000029000001920120009c0000000705000029000000000204043300000008040000290000007f0190003900000060012000390000004003200039000000e403000039000000c40240003900000002040000290000019102000041000600000003001d000500000002001d0000005f019000390000000000380435000000000373019f000000000737022f00000000073701cf0000000007080433000000000474034f0000000507a002100000000709000029000000c40300003900000197020000410000019902000041000000200120008a000000000231004905f605e30000040f0000000203000029000000020100002900000000003404350000000402000029000001810110019800000000010200190000018f020000410000006002000039000400000002001d000000000042043505f6055a0000040f0000000000240435000400000003001d00000020034000390000000004020433000000000808043b00000002010003677a65726f0000000066696369617279204f45562062656e6565207a65726f000064415049206e616d0000000000000001ffffffffffffffc0ffffffffffffff4064204944207a657244617461206665659b89c0d60f4f9f5762e1cd30555d1665431b1770c5bc0ddd3cda33511d41a8a5000000440000000002000002000000004e487b71000000005a220f5afb37aedd816845087d314951303eb8db83942ff831d654553da13df726c1f7886822cb4dcd770e93f86d9ec4c5a363e8de8e0a9f010000833ea8eec6abc9b11b922fa94375dfb475f5e197f9addaf0c5f3e354d09a2a9d77287e93a20666cf7472ed718180c036fe00b90b1b3722b686ce72da1b01000071aa077a2bb0a78bc565644d4e26ccc15a6978a90afef69474bc2bfb3cff915717e95cf852f08c7d327b623d1dc00cf2f5e14d69b02469e3d61a28f2225212a04ae578b0430200000000000000ffffffffffffff7bffffffffffffffbfcb54e6f31e139cc01af290912837797875d77acc93c6b6e6010000832145787c7fc7c103c00ca494dd8520db7e2c088b06188af794c2fb302020dba91b30cc004ae314721c4cfd502fcc1ae0c45e3addf26d36ffd29dbe56010000718e160c49ab882de59d99a32eff553aecb10793d015d089f94afb7896310ab089e4439a4c000000002d6a744e00000000d67564bd000000009ae06c84000000008dae1a47000000007dba7458000000006c9d6c09000000005849e5ef0000000050763e8400000000da1b7d0f08c379a00000000072657373207a65726572563120616464417069335365727600000002000000008000000000000000000005f600000432000005f400210423000005ef002104210000006001100039000001810220019700000020041000390000000000450435000000400510003900000181044001970000001403000039000001a403000041000005d40000613d0000000e03000039000001a303000041000005c20000613d000000000002043500000000022300190000000000460435000000000474019f00000000045401cf000000000454022f0000010005500089000000000757022f00000000075701cf0000000007060433000000030550021000000000066300190000000506600210000005b10000613d000000000750004c0000059a0000413d000000000867004b00000001077000390000000000890435000000000884034f00000000098300190000000508700210000005a20000613d000000000760004c000000050620027000000020031000390000001f0520018f000005bc0000213d000000000335004b00000000054200190000000000650435000005b40000c13d0000000107700190000005b40000213d0000019e0860009c0000000107004039000000000716004b00000000066100190000004005000039000000000651016f000000200500008a0000003f01200039000005b40000813d000001a20120009c0000000004010019000005760000c13d000005760000213d0000000102004039000000000221004b0000000001120019000000000232016f0000001f022000390000004001100039000005600000813d000001a10210009c000000c001100039000005520000813d000001a00210009c00000011030000390000019f030000410000053d0000613d000000020000000500000001020000290000004401100370000001810330009c0000002403100370000200000003001d0000000403100370000005370000613d0000005f0410008c00020000000000020000000100000005000000000304001900000001010000290000000403300370000005100000213d0000019e0410009c00000024013003700000000203000367000005100000613d0000003f0410008c0001000000000002000000000224004b00000000043100190000019e0430009c0000000203100367000004ed0000613d000000000330004c00000000030460190000000003050019000001800330009c000000000363013f000000000400a019000000000763004b000001800330019700000180062001970000000005044019000000000523004b00000180040000410000001f0310003900000000012100190000000002048019000000000131001900000000010480190000017f0510009c0000017f040000410001017f0010019d00000060011002700003000000010355000004c00000013d000004bc0000613d0000800602000039000004b80000013d0000000003060019000000010500003900008006040000390000800902000039000004b60000613d000000000260004c000000000121019f00000000010740190000017f0370009c000000000223019f000000600330021000000000030180190000017f0430009c0000000002018019000000000041043500000004012000390000019d01000041000000000051043500000060050000390000004401200039000000000015043500000000070004140000006405200039000000840130008a0000000006010019000004920000613d00008005020000390000019c011001c70000000001024019000004830000613d00008010020000390000019a040000410000044a0000613d000004330000413d0000043b0000613d000001820300004100000000003404390000012004000039000000010300003900000100010000390000016001000039000001400100003900000080020000390000000102000031000000000252019f00000000023201cf000000000232022f000000000202043b000000000535022f00000000053501cf00000000050404330000000004410019000000000242034f0000000504400210000004120000613d000000000530004c000003fb0000413d000000000645004b00000001055000390000000000670435000000000606043b000000000662034f0000000506500210000004030000613d000000000540004c00000005044002700000001f0340018f00000001040000310000000302000367000004220000c13d0000000103000029000000060300002900000040024000390000000704000029000600000001001d0000019504000041000002d60000613d000002bf0000413d000002c70000613d000000030300002900000084043000390000000104000029000000a40230003900000196040000410000024a0000613d0000000406000029000002320000413d0000023a0000613d000700000004001d0000019804000041000001c00000613d0000000506000029000001a80000413d000001b00000613d000300000002001d000200000001001d000200000004001d00000020023000390000004002300039000300000004001d00000019030000390000018303000041000004140000c13d000000000230004c0000046c0000213d000001810230009c000000a002000039000000000220004c0000000002036019000001800220009c000000000300a019000000000520004c00000180022001970000000004034019000000200420008c00000000003504350000000006050433000000a005500039000000000454034f0000000505500210000000760000613d0000005f0000413d000000000756004b0000000000870435000000a007700039000000000874034f000000670000613d000000000650004c000000050520027000000002040003670000001f0320018f0000000000310435000000570000213d0000009f0130008c000000000331016f000000bf0120003900000000020000310000018102100197000800000005001d0000000001026019000000000200a019000000000410004c0000000003024019000000000310004c00000180020000410000000001100031000000040100008a0000018d0110009c000002f80000613d0000018c0210009c0000026b0000613d0000018b0210009c000001e10000613d0000018a0210009c000001640000613d000001890210009c000000fa0000613d000001880210009c000003a40000613d000001870210009c000003510000613d000001860210009c000000960000613d000001850210009c000000e0011002700000046c0000413d000000040110008c00000040030000390000008005000039000000460000c13d000100000000001f0000017f0030019d000200000001035500030000004103550000017f0430019700000060033002700008000000000002000400000000000202780277002a02760275027402730272027100560270026f026e0055001f026d026c00fb003e026b026a0269026802670266026502640263026202610260025f025e025d025c025b025a000a00190006000a02590258025702560018025500b00254025300af002902520006000a005400530052001700510050003d0251001e02500012000900280018001600190006000a024f024e003c024d024c024b004f004e004d00170004001d000200080095024a02490248024702460245004c004b024400fa02430242004a024102400049023f023e023d003b023c023b00ae00ad003a00390048004700ac023a00ab023900aa02380237023602350234009402330232000a023100a90230022f022e022d00270093022c00010092022b0001009100090090001c0001008f000800190006000a001f0026008e008d0038004600150002000e008c0025001b00a80024000300110005003700f9022a00f800f7002300140028003800f60045001a00f5008b0003008a000500890022008800360087008600850084001d00830035001e00a7022900a600f4000d022800f300040012002100f200290082000c0003008a000500810022008000a5007f0014007e0034000100f1007d0014007c0004007b0020007a004400430004001a0079008a0003000c000500370078000d000400f000a40018001600190006000a001f00260077008d0038004600a500150002000e008c001b00ef0002000e00760025007500ee0024000300110005001c0046003700f9022700ed00f800a3002300140035001a00f500ec0003008b000500890022008800360087008600850084001d00830226001e0074000c001100a200eb007300ea00a700e900e8002100290082000c0003008b00050081002200800072007f0014007e0042000100e7007d0014007c0004007b0020007a004400430004001a0079001b0003000c000500370078000d000400f000a80018001600190006000a001f0026008e00380036004500060002000e00710025001b00230024000300110005002a0012000300700033006f022500e60009005400530052001700510050003d00f7001e00a100a000340001000d009f0094002100e5000200a6006e006d0015009e006c001c0001003200e4006b006a0069006800730041006700660224004c004b0031006500640063004a0062022300490222022100e300e20031003b00e100e000df003a00390048004700de00dd0061006000dc003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c0220005b002b00560012005a00270023000900280018001600190006000a001f0026007700db00da021f003500060002000e00710075000d004500060002000e00760025001b00230024000300110005002a0012000300700033006f009d00d90009005400530052001700510050003d00a3001e00d800d70034000100a000420001000d009f0094002100d6000200a1006e006d0015009e006c003200550034000100d500e4006b006a006900d40073004100670066021e004c004b0031006500640063004a0062021d0049021c021b00e300e20031003b00e100e000df003a00390048004700de00dd0061006000d3003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c021a005b002b00560012005a00270023000900280018001600190006000a001f0026008e008d00db00da00150002000e008c0025007500a4002400030011000500d200d1001c00a30001003200d00055003500cf003300680020007800290005002a0012000300700033006f009d00f10009005400530052001700510050003d0059001e00eb0219021800f4000d0217009c002000e5000200a6006e006d0015009e006c02160001003200ce006b006a0069006800cd0041006700660215004c004b0031006500640063004a006202140049021300cc009b009a003b00cb00ae00ad003a00390048004700ac00ca0061006000dc003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c021200c9005b002b00560012005a00270023000900280018001600190006000a001f0026007700450038003600a500150002000e0071001b00ef0002000e00760025000c00ee002400030011000500890022008800360087008600850084001d00830035001e0074000c001100a20034007300ea00a700e900e8002100290082000c0003008b00050081002200800072007f0014007e0042000100d9007d0014007c0004007b0020007a004400430004001a0079001b0003000c0005003700a9000d0021002800290018001600190006000a001f0026008e02110043004600150002000e00710025000c00a8002400030011000500890022008800360087008600850084001d00830045001e0210020f020e0001000d0044003800040012002000f2001a0082000c0003001b00050081002200800072007f0014007e0034000100e6007d0014007c0004007b0020007a004400430004001a0079001b0003000c0005003700a9000d0021002800290018001600190006000a001f00260077008d00f30046007200150002000e008c008a000d003500060002000e00760025007500a4002400030011000500d200d1001c0001003200d0005500a200cf003300680020007800290005002a0012000300700033006f009d00e70009005400530052001700510050003d0059001e00d800d70042000100a0020d0001000d009f0094002100d6000200a1006e006d0015020c020b020a020900c802080207020600c70205009a0204020302020201020001ff01fe01fd01fc01fb01fa003b01f901f801f701f6003901f501f401f300f601f2000801f1000101f0003d01ef00c6001c01ee00c601ed01ec01eb01ea0016006c003200550042000100d500ce006b006a006900d400cd00410067006601e9004c004b0031006500640063004a006201e8004901e700cc009b009a003b00cb00ae00ad003a00390048004700ac00ca0061006000d3003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c01e600c9005b002b00560012005a0027002300090028001800160002001300080030002f002e0099000b00100098000f002d000b0010003f000f002c01e500c5005801e4003e000700020013000800c4002d00c301e300c201e201e100c5005801e0003e000700020013000801df01de01dd01dc01db01da01d901d801d7000401d601d500c4000b01d4004001d301d201d101d001cf01ce00c201cd002c01cc01cb01ca01c901c801c7002b01c601c5002b005801c4003e01c301c201c101c00002000701bf01be01bd009901bc00c301bb009801ba00c10030000b0010002f002e00990098000f00c001b901b801b700c701b601b501b401b301b201b101b001af01ae01ad01ac01ab005701aa00bf001101a901a800bf009c000700020013000801a7007400be00ab01a600aa00bd00b000bc00bb00af001a00ba000601a501a401a3003e01a201a101a00057005900b900b8002a00b7019f009c019e019d0007000200130008019c007400be00ab019b00aa00bd00b000bc00bb00af001a00ba0006019a00fb019900570198019700570059019600b60195003e00b500b600b900b8002a00b700ec01940193000700020013000800060192000700950027009301910001009201900001009100090090001c0001008f0008018f018e018d009700040007004f004e004d00170004001d00020008018c018b018a009700040007004f004e004d00170004001d000200080189003c0188018701860013018500b5018400580183009700040007004f004e004d00170004001d00020008018201810180017f017e017d017c00c8017b017a00b4017901780177017601750174000901730172017101700041016f016e016d016c00b4016b016a016900fa0168016701660165016401630162009b01610160015f015e015d003a015c015b015a01590158015701560007004f004e004d00170004001d0002000800020013000800060155000700950027009301540001009201530001009100090090001c0001008f000800060152000700950027009301510001009201500001009100090090001c0001008f0008014f014e014d014c00ed014b0009014a0007014900b3000700130007014800b3000700130007014700c100c000000000000000000000000000b20146000000000000000000b200960096014500000000000001440143014200b101410000000000000000000000000140000000000000013f000000000000013e000000000000013d000000000000013c000000000000013b000000000000013a0000000000000139000000000000013801370136013501340133013201310130012f012e012d012c012b012a0129012800000000000001270000000000000126012500000000000001240123012201210120011f011e011d011c011b011a0119011801170116011501140113011201110110010f010e010d010c000000000000010b0000010a0000010901080107010600000000000000960105010400b10000000000000000010300000000000001020000000001010000010000ff0000000000fe00fd00fc00000000000000000000000000000000", - "logIndex": 11, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - }, - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x0000000000000000000000000000000000008004", - "topics": [ - "0xc94722ff13eacf53547c4741dab5228353a05938ffcdd5d4a2d533ae0e618287", - "0x010001a50a3aec77b09895657330834dffcea5d8963453f3248e9830510955ac", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 12, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - }, - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x010001a50a3aec77b09895657330834dffcea5d8963453f3248e9830510955ac", - "0x000000000000000000000000b9ed9a0ecfcc544d8eb82beebe79b03e13012d7c" - ], - "data": "0x", - "logIndex": 13, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - }, - { - "transactionIndex": 1, - "blockNumber": 3384648, - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x0000000000000000000000000000000000000000000000000009642e6c687b50", - "logIndex": 14, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500 - } - ], - "blockNumber": 3384648, - "confirmations": 819, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0f75a990" }, - "status": 1, - "type": 113, - "l1BatchNumber": 35500, - "l1BatchTxIndex": 46, - "l2ToL1Logs": [ - { - "blockNumber": 3384648, - "blockHash": "0xfecf90f960e7b74d71e1f2c00d2d6823279ac5a99523ae367910ad0b890fea5a", - "l1BatchNumber": 35500, - "transactionIndex": 1, - "shardId": 0, - "isService": true, - "sender": "0x0000000000000000000000000000000000008008", - "key": "0x000000000000000000000000000000000000000000000000000000000000800e", - "value": "0x9fd7af3b8cde88e76e27fe4a2a0f609dab94072dd3f81d78ec3e5e2e8b3fef20", - "transactionHash": "0x7a5a029cb705cc15ad41f34df867e6de673523d789d482753724a146fd55e7c2", - "logIndex": 0 - } - ], - "byzantium": true - }, - "args": ["0x9104356BB320Ab72FffbDCfe979577fc78377821"] -} diff --git a/deployments/zksync/AccessControlRegistry.json b/deployments/zksync/AccessControlRegistry.json deleted file mode 100644 index 18138e00..00000000 --- a/deployments/zksync/AccessControlRegistry.json +++ /dev/null @@ -1,610 +0,0 @@ -{ - "address": "0x0c150b404A639E603639b575B101B38B64e12D0b", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "CanceledMetaTx", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "metaTxHash", - "type": "bytes32" - } - ], - "name": "ExecutedMetaTx", - "type": "event" - }, - { - "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": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - } - ], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "expirationTimestamp", - "type": "uint256" - } - ], - "internalType": "struct IExpiringMetaTxForwarder.ExpiringMetaTx", - "name": "metaTx", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "bytes", - "name": "returndata", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "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": "address", - "name": "forwarder", - "type": "address" - } - ], - "name": "isTrustedForwarder", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "metaTxWithHashIsExecutedOrCanceled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": "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": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0x0c150b404A639E603639b575B101B38B64e12D0b", - "transactionIndex": 1, - "root": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "gasUsed": { "type": "BigNumber", "hex": "0x034bbb23" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 314819, - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x00000000000000000000000000000000000000000000000000497fe0ace57a80", - "logIndex": 12, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352 - }, - { - "transactionIndex": 1, - "blockNumber": 314819, - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "address": "0x0000000000000000000000000000000000008008", - "topics": [ - "0x3a36e47291f4201faf137fab081d92295bce2d53be2c6ca68ba82c7faa9ce241", - "0x000000000000000000000000000000000000000000000000000000000000800e", - "0x88c156f8fc02e57885c733be500d55bb97f29438f11c300046ac991170c40666" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000427a050c00000000000000000000000001000019000000000012043500000000003204350bcb06600000040f000000000001042d000000000110004c0bcb062d0000040f00000000002104350000000003000019000003da0000c13d00000000001004350000000001030019000000000200001900000000010104330000000b020000290000000402000039000000000101043b0000000b0100002900000000000104350bcb0bc90000040f0bcb06560000040f000000000100041600000024020000390000004002000039000000000202043b0000031a010000410bcb06440000040f0000000002020433000000200200003900000004020000290000000f030000290000000f0100002900000000001304350000030b0110009c0000030b011001970000000000100439000000000410004c000000000500001900000020010000390000000e020000290000000001026019000000000200a01900000000030240190000030b0200004100000000011000310000000002310049000000000201043300000000040000190000030c02000041000000440210003900000041010000390000000902000029000000040100008a00000020021000390000000006000019000000200110003900000064020000390000000402100039000000240210003900000000002004350000000a020000290bcb0bb80000040f0bcb09520000040f00000000011200190000000f020000290000000001020019000f00000002001d0000000a01000029000e00000001001d000400000001001d00000002011003670000000101200190ffffffffffffffff000200000002001d0000000d01000029000002f40420009c00000040021000390000800d02000039000000c0011002100000000c020000290000002003000039000000ff01100190000c00000001001d000000000043043500000002010003670000000000210439000000030200002900000002020000290000000101000029000100000001001d000000000112019f0000000002038019000002f40410009c00000004012000390000030c0100004100000044020000390000800501000039000000000220004c0000000d02000029000003da0000213d00000024011003700000000101100039000f00000001001d00000004010000390000000102000029000000040100002900000002010000290000000102000039000000600220021000000040011002100000030e02200197000000000404043b000000030330021000000000030000310000000000020435000000000756004b000000010660003900000310011001c70000000002000414000002f40100004100000000001204390000000103300039000000000650004c0000000202200367000000000112004b0bcb06690000040f000000000023043500000007020000290000000003010433000100000002001d000900000001001d000000200310008c000400000000000200000003010000290000000400000005000400000002001d000000000700001900000020022000390000000c01000029000000c0022002100000000001038019000002f40300004100000100033000890bcb0bc70000040f00000000003404350000000004020433000000000201001900000032010000390000000003020433000000000330004c00000005055002100000000000780435000000000707043b0000000507600210000003da0000613d0000000001024019000002f40320009c0000000005010019000000000104001900000000020400190000030b030000410000030e011001980000031601000041000d00000001001d000003fa0000a13d00000000010004140000000b0300002900000000020000310000000102200190000000000121016f000000b30000213d000000400310008c0000000a050000290000000e010000290000000801000029000800000001001d0000800b01000039000a00000001001d000500000002001d000f00000003001d0000000002040433000e00000002001d000000000203043300000000001404350000004003000039000000000221004b0000000001000031000000000301001969676e61747572656e76616c6964207345434453413a2069000000000023043900000060011000390000000502000029000002f40430009c0000000003000414000001000200008a00000004030000290000000003070433000300000001001d0000004004000039000000200300008a000000000065043500000020044000390000069c0000213d000000000303043b000000600110027000000000004504350bcb0bbd0000040f00030000000103550bcb070a0000040f0bcb09840000040f00000020032000390000000000350435000000000363019f000000000636022f00000000063601cf000000000605043300000000055200190000000008720019000000050550027000000002044003670000006002100039000000040300003900000007010000290000000000310435000000200120003900000040032000390000000b04000029000000000645004b0000002001300039000000000320004c0bcb09110000040f000d00000002001d0000030d0310009c000000000304601900000000030500190000030b0330009c000000000630004c0000030b033001970000030b04000041000700000001001d000000000300a01900000000040340190bcb0a0b0000040f0000000001210019000000060100002900000001055000390000000000670435000000000606043b0000000506500210000000000520004c0000000004030433000000000534004b000000000505043b0bcb09660000040f0bcb07e30000040f0bcb07310000040f00000004021003700000000c0500002900000000020704330000000002050433000a00000002001d000002f801000041000300000002001d00000000020004100000000101006039000b00000002001d00000080010000394d6574612d747820416464726573733a416363657373436f0200000000000000650000000000000000000000ffffffff00000b520000213d00000ad00000c13d000000000020043900000316020000410000000000630435000000600220003900000a3f0000613d000000000120004c0000003f01200039000003320120009c0000030e011001970000030e021001970000000304400210000000400100003900000000010500190000030e0710019700000310052001c70000000002034019000002f40200004100000001011001bf0bcb07c00000040f0bcb08680000040f000000000353019f0000032503300197000000020430008c0000000003020019000007070000213d0bcb06b20000040f0000000007020433000000000054043500000000050204330000000000410435000000050000000500000003030000290bcb069f0000040f000300000003001d000200000003001d000500000000000200000000012300190000000006060433000000000614001900000000052400190000030d0420009c0000030d0430009c00000bcd0001043000000bcc0001042e0000000002030019000000020000000500020000000000020000000100000005000102f40010019d0000000504300210000000010220018f00000001060000290001000000000002000000000113019f0000000001058019000000000334019f00000060044002100000000004058019000002f40640009c00000040033002100000000003058019000002f40630009c000002f4050000410bcb07cd0000040f0bcb097c0000040f0000000a030000290000000102000031000000000535022f00000000050404330000000004410019000000000242034f0000000504400210000000000530004c000000000540004c00000005044002700000001f0340018f0000000303000039000000000232016f0000000d03000029000000200310003900000000033401cf000000000434022f000000000454034f000000000774034f0000000c040000290000001f0350018f0000006003200039000000000042043500000000002404350000000104400190000000200400008a00000020055000390bcb06ee0000040f0000000401100039000000000400a019000000000504401900000004031003700000000001036019000000000510004c000000400410008c000000040120008a0bcb08260000040f0000000501300210000000000760004c00000002030000390bcb0a690000040f000000000112013f0000030e0320009c00000000020360190000030b0220009c0000030b02200197000000040210008a0bcb08c90000040f000000000121013f000000000001043900000024010000390000000001000412000000000131004b00000009010000290bcb05f80000040f0000010005500089000000030550021000000000022300190000000502200210000000000625004b000000000661034f000000000402001900000000030304330bcb0ba00000040f000000000123004b000600000001001d0bcb0b7b0000040f000000010440003900000000005604350000000505400210000000000430004c000000b30000c13d0000000102004039000900000002001d0bcb066f0000040f0000001c03000039000000010100c0390000000000560439000000050100002900000000005204390000000f0600002900000001080000290000000205000029000000000905001900000000002504350000000d040000290000006001300039000d00000004001d000200000001001d0000000000150435000000000121019f00000001020060390000006003300270696e67000000000076657274207374726c3a204e6f2072654d756c746963616c657870697265640008cc6b5d955391325d622183e25ac5afcd93958e4c903827796b89b91644bc98656c656400000000206f722063616e636578656375746564ffffffffffffff7f1901000000000000ffffffffffffff40be52ac0fd355d6210819da235addf7ad184b4a7bbb093830eb7570743e0c7ddd206c656e67746800202773272076616c75650000000000007472616374000000206e6f6e2d636f6e2063616c6c20746f023a8d90e8508b8302500962caba6a1568e884a7374b41e01806aa1896bbf2656661696c65640000656c2063616c6c20206c6f772d6c657600000000000000017a65726f0000000061646472657373204d616e6167657220f24151278f355a1d979d7dd8d271176c7e956b2e4342de31875abd51165f03870000002000000000ffffffffffffff806666696369656e7467746820696e737520686578206c656e537472696e67733aeb21e047a839171bb53935d1edc7fd642a47ea670b442974f6391f5c32d9c69d304540a733656f0d7c78024a5027094082e926ec794901d12f8788117e7eff1d383961626364656630313233343536372000000000000000696e6720726f6c65206973206d69737363636f756e7420006e74726f6c3a20617800000000000000300000000000000000ffffffffffffffffffffffffffffa00000000100000000020000020000000000000080000000007965db0b0000000001ffc9a700000000ffffffff000000006f756e740000000065206f6620616363726f6f7420726f6c726f6c652069732072656e6f756e6365616e206f6e6c79206e74726f6c3a20636f722073656c660020726f6c657320664e487b71000000008a5d092a7d5674d986f1bff1e2993881f30ad1ee0774b65b21a3ff74a15d44b87369676e61747572496e76616c696420dfe92f46681b20a05d576e7357a4501d7fffffffffffffffab882de59d99a32eff553aecb10793d015d089f94afb7896310ab089e4439a4c20656d70747900006372697074696f6e526f6c6520646573173f41414b1fdac0c03f3204090a8e7ff1351791fbaad86a532ead3ec09896be3af44e129f0b00ffacd52c909f66475c776151514217cd7cbd79b86ffe0ab8e8ffffffffffffff9f2b618abdc17a1a3f3892669e0529b6729aa3d58c074226dc76faa962e536b804747820736f7572636f74206d6574612d53656e646572206e08c379a00000000080000000000000000000000001ffc9a700000000d547741f00000000ac9650d800000000a217fddf000000009cd98f500000000091d14854000000007f7120fe0000000073e9836200000000572b6c050000000053b3a0e900000000437b91160000000036568abe000000002f2ff15d00000000248a9ca300000000e83a68880000000200000000ffffffffffffff3fa9a75d522b39400f239f7b179b0ffaca512ecc4cf759cc798b73c3c69bb8fe3d0d0df415241f670b5976f597df104ee23bc6df8224c17b489a8a0592ac89c5ad312e302e30000000ffffffffffffffc072776172646572004d6574615478466f4578706972696e6700000bcb00000432000000000101041a000000000012041b00000bc50021042500000bc00021042300000bbb002104210000001b0300003900000341030000410000000002120019000000050230021000000ba60000813d000000000223004b00000b8f0000013d000000000625001900000b960000813d000000000135004b00000000001604350000000006020019000000600400003900000b980000c13d000000010660019000000b980000213d0000030d0750009c0000000106004039000000000542016f0000003f02300039000000050310021000000b980000813d000003320210009c0000000f0300003900000340030000410000033e030000410000000d0000000500000b6c0000a13d0000033f0100004100000b5d0000c13d000b00000001001d000000800120003900000000040500190000033d0120009c000000420100003900000022042000390000033c0400004100000004040000290000004203200039000000c0012000390000000c03000029000002fa0120009c00000080024000390000000203000029000000a002400039000000090400002900000008020000290000004002200039000000c00100003900000b170000013d000a00000003001d000000240300003900000060020000390000000000320439000b00000003001d0000000003000412000c00000004001d000000c00320003900000b520000813d0000033b0320009c0000000000530435000300000005001d000000a003200039000800000003001d000000a0030000390000033a0300004100000080032000390000000b060000290000000d06000029000000000502043b00000b5a0000213d0000030e0220009c000000000223034f00000b5a0000813d000003230220009c000000000213034f0000000203000367000d000000000002000000180300003900000339030000410000001f030000390000033803000041000000800110003900000022030000390000033703000041000003360300004100000000034301cf000000000343022f0000010004400089000000000545022f00000000054501cf0000000002520019000000000353034f000000000640004c00000a280000413d000000000773034f00000a300000613d0000001f0450018f0000000105000031000000030300036700000a400000c13d000000010550019000000a400000213d0000030d0640009c0000000105004039000000000514004b0000000001030433000000000431016f00000a400000813d00000060010000390000001d030000390000033503000041000009fa0000c13d000009fc0000613d000400000003001d00008002010000390000033401000041000009e10000c13d000009ec0000c13d000000010110019000000001030060390bcb05c40000040f000009cc0000613d000000040350008c000400000005001d000100000004001d0000001e01000039000003330300004100000020014000390000004001400039000009e40000813d000002f60140009c000009ae0000c13d000000000336013f0000000004008019000000000736004b0000030b061001970000000005042019000000000531004b0000000003230049000009ae0000213d000000000214034f000009ae0000613d000000000550004c000000000506601900000000050700190000030b0550009c000000000558013f000000000600a019000000000958004b0000030b082001970000030b055001970000000007064019000000000752004b0000030b06000041000000000224034f00000002040003670000001f0540008a0000000004130049000009810000813d000003230210009c0000004004200039000009740000813d000002f60420009c00000060041002100000001404000039000000140100008a000009650000c13d00000000010004110000000000460435000000000474019f00000000045401cf000000000454022f000000000757022f00000000075701cf00000000070604330000000006630019000000000464034f0000000506600210000009440000613d000000000750004c0000092d0000413d000000000867004b00000001077000390000000000890435000000000808043b000000000884034f00000000098300190000000508700210000009350000613d00000005062002700000001f0520018f0000094f0000213d000000000335004b0000000005420019000009470000c13d0000000107700190000009470000213d0000030d0860009c0000000107004039000000000716004b000000000661001900000000010504330000004005000039000000000651016f000000200500008a000009470000813d0000000004010019000000140300003900000331030000410000090e0000613d000000050600002900000330040000410000032f011001c7000000c0023002100000000003018019000008fd0000c13d000008ff0000613d000100000007001d0000089e0000013d0000000401100270000000010330008a000000000446019f000000f80440021000000325066001970000000005230019000000000445022f0000032a05000041000000f80440015f0000000f0410018f000008b90000a13d000000000434004b0000000004070433000008b10000413d000000410300003900000327044001c700000325044001970000002103700039000008b90000413d000000020330008c00000326033001c7000008b90000613d000008860000413d000000030540008c000000000553034f000000000652001900000002033003670000002002700039000000000027043500000042020000390000008003700039000008c10000813d0000032e0370009c0000032d030000410000086b0000613d000008650000613d000000020600002900000003050000290000032c04000041000008630000613d000008230000613d000000030600002900000001050000290000032b04000041000008210000c13d000007db0000c13d000007db0000213d0000001f02200039000007c20000013d000007ca0000813d000000200120008a00000011021000390000032902000041000000370240003900000328030000410000002002400039000300000004001d0bcb08790000040f000200000007001d000000000160004c000007850000013d0000000406600270000000010220008a000000f80330021000000325055001970000000004120019000000000334022f0000032a04000041000000f80330015f0000000f0360018f000007770000a13d000000000323004b000007980000413d000000020320008c000000290200003900000327033001c700000021027000390000077f0000813d000000020220008c00000326022001c70000032502200197000007770000613d000007650000413d000000000442034f00000000054100190000002a0100003900000000030700190000075b0000413d000003240110009c00000000070100190000074c0000613d000000000224004b00000000043100190000000203100367000007070000613d000000000363013f000000000763004b0000030b06200197000000000523004b0000001f031000390000000002140049000006dc0000013d0000000000740435000000010700c039000000000770004c000006e70000813d00000060041000390000004004100039000006bf0000013d000500000003001d00000020033000390000000503000029000006d20000813d000000000113004b0000000001210049000000200100008a000000000131016f0000001f01300039000006a30000013d000006ab0000813d000000000114004b00000000044300190000002403300039000000050420021000000004043000390000069c0000c13d000000000440004c000000000405601900000000040600190000030b0440009c000000000474013f0000000005008019000000000874004b0000030b044001970000030b071001970000000006058019000000000614004b0000030b050000410000002304300039000000040320037000000002020003670000069c0000613d000000000300801900000000040320190000001f0420008c0000066c0000813d000003230110009c000000000204801900000000013100190000000001048019000002f40510009c000002f404000041000006530000613d00000322011000410000000001044019000002f40540009c0000000004000414000006410000613d000080100200003900000000033501cf00000000060404330000000004480019000000000541034f000006270000613d0000060f0000413d0000000007680019000006170000613d00000002040000290bcb0bc20000040f000100000005001d000200000006001d000005e70000c13d0000000104006039000000000441034f000000000546001900000321011001c70000004002200210000100000003001d000000010120018f000102f40030019d000000040310003900000011020000390000002403100039000003180200004100000044031000390bcb09b10000040f0000003402900039000000140290003900000060011002100000000002290019000005a00000613d000005890000413d000005910000613d00000024013000390000031904000041000005b60000c13d0bcb0a5f0000040f000005590000c13d0000030e021001980000000001000433000000000252019f00000000023201cf000000000232022f00000000053501cf000005490000613d000005320000413d000000000662034f00000000076100190000053a0000613d000000010400003100000003020003670000054b0000c13d0bcb05d70000040f0000000000000435000000f80140027000000060052000390bcb0a550000040f00000019030000390000030f0300004100000084020000390000002f030000390000031c030000410000031b0300004100000064021000390bcb06d50000040f00000008030000290bcb07200000040f00000314040000410000007f0240003900000000024200190000000e04000029000004b00000613d000004990000413d000004a10000613d00000000005204350000000e0500002900000000010204330000000f070000290000000806000029000003130400004100000001021000390000046b0000c13d000004d00000c13d000003120320009c0000030d0520009c0000000104004039000000000442004b0000000002340019000000000442016f0000003f0240003900000000021400190000042b0000013d0000000000760435000000000707043300000000072500190000000006150019000004330000813d000004e80000c13d00000016030000390000031503000041000004210000c13d000f00000004001d0bcb0bae0000040f000004e60000c13d000000000232004b0bcb07110000040f000004020000a13d000000000403043b0bcb0a480000040f000005140000a13d000003170230009c000005090000c13d000000410220008c000f00000007001d000a00000008001d000000800530008c000000000372004900000004078000390000030d0380009c000000000803043b0000030b0000013d000003e70000613d000d00000005001d0000033e0000613d000000040220008c00000001050000390000000002430019000000000272019f00000000026201cf000000000262022f0000010006600089000000000767022f00000000076701cf000000000705043300000003066002100000000005530019000000000252034f000003330000613d0000001f0640018f0000031b0000413d000000000772034f0000000008730019000003230000613d00000005054002700000000202500367000003dd0000813d0000000001000410000000000310004c0000031104000041000004fa0000c13d00000002024003670000000f04000029000f00000005001d000000800310008c000000000151004900000004052000390000030d0320009c000000200420008c0bcb07180000040f00000004011003700000000f0100035f000f000000010353000001de0000013d000000010200c039000c00000002001d000000000121004b000e00000006001d00000000060100190000020e0000613d000000040520008c00000001060000390000000001430019000000000161019f00000000015101cf000000000151022f000000000656022f00000000065601cf0000000006020433000000000121034f000002030000613d0000001f0540018f000001eb0000413d0000000007630019000001f30000613d0000000502400270000004db0000813d000500000008001d000700000007001d0000000001070019000000000141019f00000000011201cf000000000212022f0000010001100089000000000414022f00000000041401cf00000003011002100000000003380019000000000232034f0000000503300210000001d50000613d000001be0000413d000000000552034f0000000006580019000001c60000613d000000050330027000000020082000390000001f0130018f00000000007204350000030d0410009c000000200200008a0000003f0130003900000005037002100000030d0170009c00000000070200190000031d03000041000004160000c13d0000030e0310009c0000000101000039000002fb030000410000000000370439000000070300003900000000004104390000000000530439000002e0030000390000000000830439000002c0030000390000000005030433000002a006000039000000000096043900000000050704330000000307000029000002800600003900000260060000390000000000760439000000000501043300000240060000390000000000150439000002200500003900000200020000390000006005000039000001e00200003900000000006204390000000005080433000001c0020000390000000000250439000000000045043900000020040000390000000000240439000000000003043900000004070000290000014003000039000002f902000041000000e001000039000000c001500039000000bb0000a13d000002fa0150009c000000a002000039000000a001500039000000800250003900000006050000290000002002300039000002f9010000410000004001300039000600000003001d000000c002000039000700000002001d00000120020000390000000e03000029000001000200003900000180010000390000000501000039000002f701000041000a00000005001d00000020052000390000004001200039000000b30000813d000002f60120009c0000018002000039000002f5010000410000001701000039000001a0010000390000016004000039000000010210018f000003200110009c0000031f0210009c0000031e021001970000030a0110009c000003510000613d000003090210009c000002fc0000613d000003080210009c000002e50000613d000003070210009c000002a40000613d000003060210009c000002760000613d000003050210009c0000025a0000613d000003040210009c000003c20000613d000003030210009c0000022c0000613d000003020210009c0000037b0000613d000003010210009c0000019a0000613d000003000210009c0000016d0000613d000002ff0210009c000001430000613d000002fe0210009c0000011f0000613d000002fd0210009c000000f80000613d000002fc0210009c000000e001100270000003da0000413d000000040110008c000000580000c13d000100000000001f000002f40030019d00020000000103550003000000410355000002f404300197000f0000000000020085050b00bc01b3050a050905080507050600480505010d0018010c000200bb050405030055001105020501050004ff04fe04fd04fc04fb04fa04f904f804f704f604f504f404f304f204f104f004ef04ee04ed04ec04eb04ea04e904e804e704e604e5000a00160006000a0035002d002c00840009002b00230025002a0022000c00290006000a00680047001104e400ba000a04e3000d01b204e20001010b01b104e10012000e0008001d0009001504e000b9005400160006000a04df0053002104de00b804dd04dc000200b704db04da04d9002104d804d704d601b004d5000200b6010a010c010d0046000800b504d401af00b401ae00070028001c00450044000704d300b304d20003008304d101090002010800b2002400b100b0001004d0001b04cf008200020020008104ce04cd0028000801ad0034000804cc04cb00b600020044002400af0080001b04ca01ac001f04c9000204c8000f000804c701ab04c604c5001a000b00330010000200170001000404c400210107010600ae000700ad01b004c3000f000804c204c1007f04c0010504bf01ac04be04bd010601aa01a904bc010404bb04ba01a804b901a704b804b701a6000e04b604b501a604b404b304b201a504b104b004af01a404ae04ad04ac04ab04aa01a404a904a804a704a604a504a404a304a204a1001500160006000a0035002d002c00840009002b00230025002a0022000c00290006000a006800470011000b04a0001d004300020001000f00070014000f001c0052000101a30002004200410009001500160006000a0035002d002c00840009002b00230025002a0022000c00290006000a006800470011000b0027006700130001000f000700660014000f001c0002004200410009001500160006000a0035002d002c00ac0009002b00230025002a0022000c00290006000a0055010300190043006500110045007e0020000b002700130018000100070066001401020020002801010001000d0009001500160006000a0035002d002c00ac0009002b00230025002a0022000c00290006000a00550103001900650011049f00640045004301000041007d049e0012000e0032049d0003003b01a2000300310008003a005100030039000400160006000a00bb01a100b2049c049b00ab049a0499049800aa000f001c004001a000ba000d019f049700ab00a9019e000f0002003404960495049400a8007c0493019d04920030019c0491049000ff019b019a00fe048f0025048e048d048c048b048a00fd048904880019048704860485048400210483048204810199008000b000380198000901970480004400b4019600a7019501940047047f00fc047e002600fb047d019300fa00f900f80192047c047b007b047a019104790190018f0478047704760011018e047504740473000204720013047100a6010a0470046f00260037018d046e046d00af000e0041046c00a5019100f7046b00f600a400f5001f00630002018c000e018b00a501a50050004000280062000d046a0008007a0080046900160006000a0035002d002c00840009002b00230025002a0022000c00290006000a006800a4004700110045007e0012000e006700a30024018a006300790189018800610060001b0028018700a2000d01b200200008001d0009001500160006000a0035002d002c00840009002b00230025002a0022000c00290006000a0068004700110067007e002001860001000d0009001500160006000a0035002d002c00ac0009002b00230025002a0022000c00290006000a00550468006500110045007e046704660011000b0027006700130001000f0007002804650014000f001c0052000101a30002004200410009001500160006000a00bb018500a10464003000f4018400fc00f3018300a001820062000a0010007c00190463006404620461002c04600009002b00230025002a0022000c00290006000a045f003f045e045d001901810064018000a2045c009f017f009e00780077009d009c004f0076004e017e045b003e0048009b0001000d0009001500160006000a0035002d002c045a0009002b00230025002a0022000c00290006000a0012000e0013001d0009001500160006000a00bb01a100b000420083019900b2003800f204590053000900340197045800af00b4019600a70195009e019400a604570456007b04550037009a04540453009900980075007404520451017d04500097044f044e044d044c044b044a0019044904480447044601ab044500730444005004430442005000260037018d009e0044000e001f018b00a5017c008000400045044100f500280002006300620440001f007a043f00160006000a0035002d002c00ac0009002b00230025002a0022000c00290006000a0055010300190043006500110045007e0020000b0027001300180001000700660014010200200028017b0001000d0009001500160006000a00a8017a00a10179003000f40023017800f30022009f01770006000a00550176043e043d0064043c043b00f1043a0026017500f000ef017400ee00ed00ec0096000a0065001100eb00640439017304380172004500ea0020017f0053007200ae006300e9002f04370436004d0095043504340012002f0043005f0002005e0433001f002e000c000400160006000a00a8017a00a10179003000f40023017800f30022009f01770006000a0055017604320065001100eb04310001000d00040012000e0067003d0430001f002e000c00090015003d001c001f042f00a5002f00e8042e0012002f0043005f0002005e042d001f002e000c0004001a000b009400100002001700010004042c0173017200e8042b0012000e0032042a0003003b0429000300310008003a0051000300390004003f0028018700a204280020017b0001000d000900150072005300b600e9009300920012008100e7002600e604270426017104250424042304220421007300540420017001ae041f041e041d0030041c041b00ab016f019e00e5016e00b7000700e500b500e40021016d00e3001f00e2041a00ab016c00e50091001c000700b2000b0027008300130001000f000700660014000600200419003d003f00f201000041007d041800e101860044000b018c0013001801a0000100070066001400b000010034000704170020009000780077009d009c004f0076004e00e0041600ad04150414003e0048009b003404130008004d04120411016b00df016a00de00dd007b04100037009a00dc01690099009800750074040f00ef040e0097016800db007100da00d900d80070008f0167016600d700d6040d040c00730080006f0165007f040b01640163008e005d008d006e004c005c006d01b10077004c005c008c005b0076004e0162040a00ad01a7003e0048009b003f0093004404090012000e003d0008001d000900150012000e0067003404080407001f002e000c00090015003800040012000e040604050003003204040003003b0403000300310008003a00510003040200040012000e003204010003003b0400000300310008003a00510003003900040012002f0043005f0002005e03ff001f002e000c000400df00920038000e000f001c03fe00d600e4002103fd00d50021008b000203fc00a6000903fb000603fa03f903f801610012000e0160015f03f7002600fb03f603f500fa00f900f800e603f4015e03f3015d015c015b0071015a03f201590019008f03f103f003ef016e0158000403ee03ed03ec0012002f0043005f0002005e03eb001f002e000c00040041007c0019018100640180000f001c00b600a203ea00780077009d009c004f0076004e017e03e90104003e004800410157009b03e8015600a400440032002000d400530107002001560028008a00ad016b016a00de01aa00dd007b03e70037009a00dc0169009900980075007403e600ef03e50097016800db007100da00d900d80070008f0167016600d700d603e403e3000203e200ae000803e10155004b002803e0000f009500b40093000c00d3001f002e000c0009001500ae03df03de007f03dd03dc007f0031000803db001d007f0039000401540153015201510150014f014e014d005d014c004f014b003e00bc01b303da00d203d90005014a03d8008e004c005c005d008d004f03d7005b03d6006c00d1014901480009014703d503d4007000d0007a019d003003d3016f03d200d200cf0146004201450005014403d103d001540153015201510150014f014e014d005d014c004f014b03cf01a803ce01610160015f03cd002600fb03cc019300fa00f900f800e603cb0148015e03ca015d03c903c8007103c700d900d800ff008f015903c600d7009100d200cf0146004201430005008e005d008d006e004c005c006d005b0077004c005c008c005b007603c500d100a903c4001100050001000d000400bc007803c303c203c1004f006d004003c0014200d100a903bf001100050001000d000403be03bd03bc006e03bb009d03ba006d00f60141008e004c005c005d008d006e006d005b014003b903b800050001000d0004018500a103b7003003b6018400fc03b5018300a00182006203b403b303b200ce013f00cd03b103b003af003703ae03ad03ac03ab03aa03a903a803a703a603a503a403a3015c0019013e00cd03a203a103a0039f00cd000c00050001000d000400810003008a003000fe039e013d00cc013c013b00cb039d013a0013039c00ca039b004000050139004600810003039a0399005a0138017c00b3004000360009006b03980397005900f601370396039503940021006a00380046000e01360135007a0093039300420134000500c901330132039201310391003700740390008a0130038f0089038e038d007500cc038c038b00380008000c00a0012f0005038a00f1038900260175038800f003870174038600ee00ed00ec00960385038400ce013f012e003803830382012e014200050001000d0004012d001d00080036000c01360005012d001d00080036000c012f0005006f003c001d000200180001000700050144004a005a000b0027001300180001000700660014010200590058010101430005008500c8003f0057003c001d004a0073005a00180088000100070069006f0082003c005800020001001e00070014005203810087000501490086006a000e0380037f037e001a000b003300100002001700010004037d01ad001e0002037c002100e700a8007c00090147037b037a007000d0007a012c0379010500620378002f037703760008010503750374001a000b00940010000200170001000403730095012b0372000303710370036f00c7036e036d036c0071036b036a03690368015a03670366012a009103650364036303620001010b0361012900860360001e0092035f035e035d0003005a035c006b0128035b0008035a005901280135002e03590021000c0155006a002f0088005f0002005e005700d300c6002e000c00040081003000fe0358013d00cc013c013b00cb0357013a00130005035600ca0163004000ba000d019f00eb035500a90354001800020005001a000b00330010000200170001000400850109005a000b0027004600130018004a000100070057006f0109003c001e00020001005800070014005203530059000b006a00130018004a000100070057003c001e00020001005800070046001400c500aa0127001e0090003f012600c400c30125008c01240123004e00e00352012203510350003e0048034f008700050001000d00040085004a00c8000b00270046001300180082000100070058006f004a003c001e000200010069000700140052034e0086000b006a001300180082000100070058003c001e00020001006900070046001400c500aa001e0090003f012600c400c30125008c01240123004e00e0034d0122034c034b003e0048034a008700050001000d00040006034900050121000e00320348000300310008003b00510003003a000300390004014a001801300347034603450003034403430342007203410030019c0340033f00ff019b019a033e033d00c70096033c0095012b033b000300c7033a0339033800fd0337033600540335012c033403330332033103300120032f032e032d032c00da032b032a032900d003280327032600060001010b03250129005901450005001a000b009400100002001700010004001a000b0033001000020017000100040139011f00b300620324005a010001af000b002700c80013001800880001000700c2003c005700020001001e0007001400520323006b00690101003f001e001c011e0002007800c400c30322004c009c006e0321005b0320004e0162031f01a9031e003e0048031d013400050121000e0032031c0003003b031b000300310008003a00510003003900040001000d0004031a011d0319011c0318031703160315031403130089031203110310030f030e00cb0008030d030c030b030a00de01650309017d030800890307030603050304030303020301030002ff02fe02fd02fc02fb018f02fa02f902f80070018e02f702f602f502f4019000730005001a000b0033001000020017000100040001000d000400a30024018a001000790189018800610060001b011f02f300ba02f202f1002d0047001100cf000500b900b702f0016d02ef00e3013302ee02ed02ec0054001c00070005001a000b0033001000020017000100040047001102eb02ea00050001000d0004007202e902e802e702e6001902e502e4008902e302e202e102e002df02de02dd02dc02db02da02d9004002d80019013e02d702d6003800f102d5002602d400f002d302d202d102d000ee00ed00ec009602cf00050001000d00040085009e00b900fd02ce02cd02cc0138002102cb02ca00e202c902c800b800a602c702c6000902c5009200d5001e02c40006000902c3013700f500bc00b7008602c202c1011b001e02c002bf00240068005602be001702bd001b00c6000602bc000c00870005001a000b003300100002001700010004011b02bb006b002f0088005f0002005e006900d300c6002e000c000400e70004006b000e003202ba0003003b02b9000300310008003a005100030039000402b8015800e8011a011d02b7011c00ca02b600b902b5015b02b4002602b302b202b102b002af00540008003602ae02ad02ac00dd007b02ab0037009a00dc02aa009900980075007402a902a8011a009702a702a60120013202a502a400ce02a302a202a1012a00030005001a000b00330010000200170001000400df02a00003004d029f00030036029e0003001d0008029d0005004d029c00030036029b0003001d000800c10005004d029a0003003602990003001d000800c10005029802970296001900ea02950294003602930019010c02920291004d005300d4007200e9002f0038000700500119007c029000c900b500e4028f0118016c028e0118028d0021028c00e300e2028b028a00030289028802870286028502840091001c02830007011701160282001000ea02810280027f027e027d00c0004600610060001b010a011e004a007d01150108002400b10063001b01170116000f016400c00050015700c0008300610060001b0034007d011500a30024004b000f00560027003d007900610060001b027c008b000e008300a300f20024004b000f0056027b003d007900610198006000b3001b0034008a0082000200e10024004b000f0056010d003d007900f700c2001b0034027a000200e10024004b000f005602790044005600f700c2001b0034011900020108002400b10063001b02780277027600030275000200a000af000202740273011402720021001c005900070104010602710270005400d5026f0054026e00b8026d0002026c026b0114026a00b8001c000c000700a4000b006c00270269010700080001005000070014005202680267002400b10010001b0057007d0266004b000b0012003d00080018000100070053001400c500aa012700500090004b02650005001a000b0033001000020017000100040001000d0004008b000e003202640003003b01a2000300310008003a00a7000300390004008b000e003202630003003b0262000300310008003a00a700030039000402610260025f025e0170025d00c900b500db01920037025c025b025a02590258013102570256002602550254025301710252009f025100420005001a000b0033001000020017000100040250024f024e024d00d40005001a000b009400100002001700010004004d024c00030036024b0003001d000800c10005024a006c0005000d00050249006c0005000d00050248006c0005000d00050247000502460005024501410140000000000000000000000113024402430242000000000000000002410240000000000000023f023e023d023c023b023a0239023800000000000002370236000000000000000000000000023500000000000002340000000000000233000000000000023200000000000002310000000000000230000000000000022f000000000000022e000000000000022d000000000000022c000000000000022b000000000000022a00000000000002290000000000000228000000000000022702260000000000000225000000000000000000000000004900000113004900490224022302220112011100000000000002210220021f021e000000000000021d021c021b021a02190218021702160215021402130212000002110210020f020e020d0049020c020b020a02090112000002080207020602050204000000000000020302020000000001100201020001ff01fe01fd01fc01fb01fa00000000000001f900000000000001f80000000000000000000001f7000001f6000000000000000001f50000000000000000000001f401f300490049004901f200000000000001f1000000000000011001f001ef000001ee01ed01ec000001eb01ea0000000001e901e801e701e601e501e401e301e201e101e001df01de00000000000001dd0111000001dc000001db01da01d901d801d701d601d500000000000001d40000010f01d301d201d101d001cf01ce01cd010f01cc01cb01ca01c900000000000000bf00be00bd01c800bf00be00bd01c700bf00be00bd000001c601c501c401c300000000000001c201c100000000000000000000000001c0010e01bf01be01bd01bc01bb01ba01b9010e01b80000000001b701b601b501b40000000000000000000000000000", - "logIndex": 13, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352 - }, - { - "transactionIndex": 1, - "blockNumber": 314819, - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "address": "0x0000000000000000000000000000000000008004", - "topics": [ - "0xc94722ff13eacf53547c4741dab5228353a05938ffcdd5d4a2d533ae0e618287", - "0x010003434fee1c75e5ca83c5574aa5d9058caab3cf105a33336f85fe6cd747f8", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 14, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352 - }, - { - "transactionIndex": 1, - "blockNumber": 314819, - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x010003434fee1c75e5ca83c5574aa5d9058caab3cf105a33336f85fe6cd747f8", - "0x0000000000000000000000000c150b404a639e603639b575b101b38b64e12d0b" - ], - "data": "0x", - "logIndex": 15, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352 - }, - { - "transactionIndex": 1, - "blockNumber": 314819, - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x0000000000000000000000000000000000000000000000000018634e53779300", - "logIndex": 16, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352 - } - ], - "blockNumber": 314819, - "confirmations": 592, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0ee6b280" }, - "status": 1, - "type": 113, - "l1BatchNumber": 3352, - "l1BatchTxIndex": 393, - "l2ToL1Logs": [ - { - "blockNumber": 314819, - "blockHash": "0x601046f9632fca8528d3e69ea71ee4e24681ee0ee60b3e9bf80f4d702bc50dc0", - "l1BatchNumber": 3352, - "transactionIndex": 1, - "shardId": 0, - "isService": true, - "sender": "0x0000000000000000000000000000000000008008", - "key": "0x000000000000000000000000000000000000000000000000000000000000800e", - "value": "0x88c156f8fc02e57885c733be500d55bb97f29438f11c300046ac991170c40666", - "transactionHash": "0x5a4c61beafddd21b6412aa6ac467161302075d54ff3f0da610f28f8b58bf989f", - "logIndex": 0 - } - ], - "byzantium": true - }, - "args": [] -} diff --git a/deployments/zksync/Api3ServerV1.json b/deployments/zksync/Api3ServerV1.json deleted file mode 100644 index 1d8db8ad..00000000 --- a/deployments/zksync/Api3ServerV1.json +++ /dev/null @@ -1,863 +0,0 @@ -{ - "address": "0xAC26e0F627569c04DAe1B1E039B62bb5d6760Fe8", - "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": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xAC26e0F627569c04DAe1B1E039B62bb5d6760Fe8", - "transactionIndex": 3, - "root": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "gasUsed": { "type": "BigNumber", "hex": "0x05050118" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 314845, - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x0000000000000000000000000000000000000000000000000072bf6b60b69880", - "logIndex": 32, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353 - }, - { - "transactionIndex": 3, - "blockNumber": 314845, - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "address": "0x0000000000000000000000000000000000008008", - "topics": [ - "0x3a36e47291f4201faf137fab081d92295bce2d53be2c6ca68ba82c7faa9ce241", - "0x000000000000000000000000000000000000000000000000000000000000800e", - "0x3bb7506038cd0b0f3ca1d4115458116a3836ebff61fc8355f338d42b0a5be957" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000006f6a07ce0000000000000000000000000100001900000000003204350000000000120435000000050100002916f10bfe0000040f000000000001042d0000000001010433000000000110004c0000000003000019000000b30000c13d0000000000100435000000000021043500000000010300190000000402000039000000240200003916f10bcb0000040f00000600010000410000000a0200002900000020020000390000000a01000029000000000201043316f10bf40000040f000e00000001001d000005c10110009c00000000010004160000000e02000029000005c101100197000013ba0000413d0000000005000019000000000200001900000000070000190000000e01000029000000000410004c16f116ef0000040f0000000e030000290000000001026019000000000200a0190000000003024019000005c1020000410000000001100031000000040100008a0000000002010019000000000202043300000032010000390000006402000039000005c802000041000000000600001900000000040204330000000000450435000000040210003900000024021000390000004402100039000005c108400197000005c106000041000e00000002001d000000000660004c000000000607c019000005c10880009c000000000898013f000000000a98004b000005c109300197000000000734004b00000000030504330000002002100039000000000023043516f116d10000040f0000000000130435ffffffffffffffff0000000006008019000000000706201900000000023100490000001b0100003900000020030000390000000d02000029000000410100003916f10be20000040f000000000101043b00000000040000190000007f0000213d0000002001100039000d00000001001d0000000201100367000000b30000213d00000040010000390000000d010000290000000401000039000000000202043b00000000001004390000000802000029000000000220004c000000030200002900000000010200190000000d03000029000000200310008c000000000303043b00000000010a00190000000001120019000000000112019f16f116ed0000040f000000000024043500000000002004350000000a030000290000000003010433000005c1050000410000000003030433000000000310004c16f114ce0000040f16f115160000040f0000004002100039000000400200003900000040011002100000000b0100002900000007010000290000000b0200002916f1153a0000040f000000040100002900000009020000290000000000410435000000090100002900000004020000290000000502000029000000000112004b000005c2011001970000000101000039000d00000002001d00000000020404330000007f0000c13d00000000001404350000000101200190000000000301001916f114860000040f16f1155e0000040f000000000550004c00000000020304330000000801000029000c00000001001d16f116de0000040f000005be0410009c00000001020000390000000c02000029000800000001001d0000000003020433000900000001001d000005c10330009c000005c104000041000d00000003001d0000145a0000a13d16f1165a0000040f16f115ca0000040f000013ba0000a13d000400000005001d000005c10550009c000100000002001d000000030110008c000000000404043b0000000202000029000000000320004c00000000010a04330000000000250435000500000001001d0000000c03000029000000010100c0390000800d02000039000000000203001900000001022001900000000403000029000000000440004c0000000c010000290000000601000029000b00000001001d000e00000003001d000000000330004c00000000030460190000800b0100003916f10c9a0000040f00000000010004140000002002200039000000040120003900000000020400190000000105500039000000440200003900008005010000390000000000120439000005f201000041000000000200003116f115ee0000040f000000060220008c000000000987004b000000030500002900000000020a043300000001020000290000006002100039000000400400003900000005011002100000004003000039000000000131001900000004050000290000000101000029000000000441001900000009030000290000000000430435000005c801000041000000040220008c000700000001001d0000000103300039000000000131004b000009a60000a13d000000000650004c000005ec011001c7000005c107300197000200000001001d000000200300008a00000001077000390000000e04000029000300000001001d00000001010020390000000201000039000c00000002001d00000004011000390000000003050019000000000400a01900000001020000310000000000540435000000000505043b000005c10300004100000020044000390000000506500210000000000540004c0000000000510435000000020320008c000000c005100039000013b00000013d000000050a00002916f114f20000040f16f115a60000040f16f114aa0000040f000000000506c019000005c10770009c000000000787013f000000000500a019000000000605a0190000000003430019000000600110003900000060022002100000000000340435000000c00110021000000005030000290000000000000435000005be0420009c000005be01000041000000000113004b00000006020000290000000000020435000000000756004b000000010660003900000000002104390000000001030433000000000121004b00000005022002100000000000670435000000000606043b16f10e770000040f000000000223004b0000002401000039000000b30000613d0000000e05000029000000c0023002100000000001028019000005be0430009c0000000003000414000005be02000041000600000001001d0000000102004039000000000121016f000000020220036700000000010400190000002001300039000005c10620019700000020024000390000000b0300002916f10d510000040f000000000300003100000001033001900000000000890435000000000760004c0000000702000029000005c30310009c000005c10330019716f10c780000040f000000e003100270000000200100003900000000040100190000000504300210000000000300a01900000000010000310000000000650435000000000606043300000001066001900000000106004039000000000500801900000000060580190000000504400210000000000645004b000000000707043b0000000001000412000000000301043b000000020100036769676e61747572656e76616c6964207345434453413a2069020000000000000064415049206e616d00000000ffffffff000000070220008c000015320000613d000000e005100039000000800510003900000003060000290000000005050433000000000a000019000013840000013d000013ba0000613d16f115820000040f000000000304c01900000000030a0433000005c108200197000000000623004b000000020110008c000013b80000013d000000010400008a16f113ca0000040f00000f480000a13d000000000304043300000002050000290000000103000029000006070120009c000000000502043300000005000000050005000000000002000100000001001d000000000523004b000000000203801900000002000000050002000000000002000000010000000516f116e30000040f000000000113019f000100000005001d0001000000000002000000000035043900000001040000290000000001050433000300000001035500000002040000290000002001200039000000c0022002100000000001044019000005be0320009c000000000200041416f1100b0000040f00020000000b001d0000001b03000039000000000252019f0000010003300089000000000535022f0000000303300210000000000530004c00000005044002700000001f0340018f00000002010000290000000301000029000800000003001d0000002001400039000000200500003900000005055002100000000000780435000000050760021016f110980000040f000000000402001916f110500000040f000000000534004b0000000104400039000000000221004b000000000120004c0000000c04000029000000000210004c0000000202100367000005c202100197000000020300003900000000030280190000000803000029000b00000003001d000000000112013f0000000000010435000001000550008900000003055002100000000000530435000000000403043316f10cde0000040f000000000242034f000300000002001d000005be0220019700000000002c043500000003022002100000000506600210000000000867004b000000000808043b0000000508700210000700000002001d000800000002001d16f10c7e0000040f0000000005044019000000200220008c000005c30410009c0000000105004039000000000102401916f10b730000040f0000000d050000290000000000560435000000200500008a000005c104400197000000000614004b000005c30420009c000000000520004c0000000b04000029000005c30750009c000005c10220009c000005c102200197000005c30430009c000005c10440009c00000000050404330000000301100210000000000510004c000000b30000413d000000040120008c000a00000001001d2075706461746520446f6573206e6f7465207a65726f00006368000000000000426561636f6e2073657373207a65726f0000169a0000413d000016760000413d0000162e0000413d0000160a0000613d000015e60000413d000015c20000413d000000050110008c000000a002100039000000050220008c000000040320008c000000030220008c0000006005100039000000010320008c000014c60000613d000000040110008c000000a0051000390000008002100039000000030320008c0000147e0000413d00000000005b0435000014570000613d16f114620000040f000000000405c019000005c10660009c000000000676013f000000000876004b000000000504a019000000000b010433000000000212004b16f1167e0000040f0000000000290435000000080230008c000000020a00002916f116360000040f16f116120000040f00000000002b0435000000000565013f000000000765004b000005c106800197000005c105200197000000000403a019000000000482004b000000020330008c000000000a010433000000e004a00039000000070110008c000000000634004b0000000004066019000000000405a019000000000423004b000000000605201900000000030c0433000000000112016f000000ff02300270000000010440018f000000000421016f00000000030260190000000004016019000000000445019f0000000105100270000000ff04400210000000000400c019000005c105100197000000000335019f0000000105200270000000ff03300210000005c1032001970000000002320019000000000323004b000000000413004b000000010320008a000000090120008c000011430000213d000010cc0000613d000000000600a0190000000505500270000000000431016f000000050520021000000017030000390000001303000039000000010550019016f1114e0000040f000400000001001d000000000121019f00000019030000390000006002300039000006050230009c000200000002001d00000060063000390000000005030433000000010210008c0000001f030000390000000000460435000000200310003900000002044003670000003f01200039000000000302001916f10cf10000040f000400000003001d000100000003001d000000000542001900000cc20000213d000000000224004b00000c970000213d0000000203100367000000000363013f000000000763004b0000001f031000390000001f022000390000004001400039000000400500003900000040042000390000004001100039000006040210009c000016f300010430000016f20001042e0000000001038019000005be03000041000105be0010019d0000006001100270000000000441034f000000010220018f0000000001058019000000000334019f00000060044002100000000004058019000005be0640009c00000040033002100000000003058019000005be0630009c000005be0500004116f10c2e0000040f16f10c150000040f000000040310003900000024031000390000004403100039000005fb011001c7000000a0020000390000000104400190000000000232013f000000000223022f000000010300008a0000002003300039000a00000002001d16f10e910000040f000000060600002900000005050000290000000403000039000005be0340009c0000000002018019000000000701043b000000030300002916f10f910000040f0000000101200270000000060300002900000000023201cf000000000232022f00000000053501cf000000000662034f00000000076100190000000104000031000000030200036700000000002304390000002005500039000e00000005001d0000000a05000029000005c2021001980000000501300210000000010500003900000000087300190000000005010019000005f10210009c000000400310008c0000000001020433000000010210018f0000000001210019000b00000002001d000000000601001916f10b960000040f0000000002230019000000000625004b000000000661034f000000000123004b16f116a20000040f000000000430004c0000000503300270000000000702001916f10cc50000040f0000000002032019000000000243004b0000000002042019000000e002100270000000e003400270000000000100041116f10e650000040f0000000000010439000005f10220019700000020043000390000004001200039000000000020043916f10f790000040f16f10d920000040f0000000101006039000005c20110019816f10dc50000040f16f10dfb0000040f16f10e4c0000040f000000000241004b0000000001140019000000200200008a0000004001a00039000000000272019f000000000757022f00000000075701cf00000000070604330000000006610019000000000750004c0000002003400039000900000002001d0000000001036019000000040120008a16f10c450000040f000000110300003916f110e70000040f0000000004008019000000000716004b00000000050420190000000202000367000000020210008c16f10fe20000040f0000000103004039000000000232016f000000000525022f0000010002200089000000000604043300000005040000290000000002000410000005e90100004116f10fd00000040f000000e001100270000400000002001d16f10fbe0000040f000000010100403900000e100110003916f10ca80000040f000005c30210009c0000002403100370000005c20330009c000600000003001d000000040310037000000003010000390000001803000039000005c20220009c0000000001340019000000600410018f0000001f01100039000000200120008c000000000443004b0000000004000031000000000324001900000000003104350000000001060019000000000114013f000000000403401900000000020560190000000002060019000000000272013f000000000872004b000005c107400197000900000003001d000005c104200197000005c10100004100000100011000890000000203000367000000600100003900000060033002700004000000000002696e67000000000076657274207374726c3a204e6f2072654d756c746963616c7465640000000000616c20726576657257697468647261776f6e730000000000616e7920426561637370656369667920446964206e6f742067206572726f7200706563617374696e56616c7565207479fffffffeffffffffffffffff80000000636f727265637400677468206e6f742044617461206c656e700000000000000074696d657374616d6c6964000000000070206e6f7420766154696d657374616d426561636f6e730068616e2074776f2064206c6573732074537065636966696565740000000000001a664b35be4b2349354a4d0f4ad0b7db8c56ac9613c09491b7712be6248d021effffffff000000006400000000000000697469616c697a6564206e6f7420696e4461746120666565740000000000000065206e6f742073653a0a333200000000204d6573736167656d205369676e65641945746865726575dfe92f46681b20a05d576e7357a4501d7fffffffffffffff206c656e67746800202773272076616c756500000000000065206d69736d61745369676e6174757200000000000000010000000100000000ffffffffffffffa0ffffffffffffffc00200000200000000464358975b36efb7da4d37d7219ba05e32e253bc4b8a17b91ffdb573afe727393c209e9336465bd123bf29dc2df74b6f266b0e7a08c0454b42cbb15ccdc3cad64e487b7100000000362f93160ef3e5634ba6bc95484008f6d60345a988386fc8290decd9548b62a8185087fc5553a5b60c39b067df172dd575ff1971e3f261046ef25c3ab4fb9cba617279206164647242656e6566696369792062616c616e634f45562070726f78d7d6958eddd9ca6ccafb79f92044ab338dfea1875af447840472be967f9a37130e15999d00000000023a8d90e8508b8302500962caba6a1568e884a7374b41e01806aa1896bbf2659f587339865294f51b6a6778d97fd9522cb5d9b3491cd5fcf3a9aac9b6ac0f840000002000000000616d650000000000742064415049206e616e6e6f7420736553656e646572206391d1485400000000ab882de59d99a32eff553aecb10793d015d089f94afb7896310ab089e4439a4c65000000000000007369676e617475724d697373696e6720ef1ea3a427a6a0eed4c044a35b0369c4366ad68f07eb69bac856aaa4e639403f44206d69736d6174426561636f6e20490c2cc65dc6568a7fdffe48c903d6bbbcea2ff0520d79f8efdd29860e0772a39d0000004000000000736d6174636800006574204944206d6974757265730000006768207369676e614e6f7420656e6f750d0df415241f670b5976f597df104ee23bc6df8224c17b489a8a0592ac89c5ad08cc6b5d955391325d622183e25ac5afcd93958e4c903827796b89b91644bc98125fc972a6507f396b1951864fbfc14e829bd487b90b72539cc7f708afc6594400000000009f2f3c00000000f8b2cb4f00000000f83ea10800000000e6ec76ac00000000cfaf497100000000b62408a300000000ac9650d800000000a5fc076f0000000091eed085000000008fca9ab9000000008e6ddc2700000000796b89b9000000007512449b0000000067a7cfb7000000005989eaeb0000000051cff8d9000000004dcc19fe000000004c8f1d8d00000000481c6a7500000000472c22f100000000437b91160000000042cbb15c000000003408e4700000000032be8f0b000000001ce9ae07000000001a0a0b3e0000000000aae33f00000000fce90be841435220616464726d70747900000000697074696f6e20656c6520646573637241646d696e20726f08c379a0000000007a65726f0000000061646472657373204d616e616765722000000002000000006520736574746572ffffffffffffffbf8000000000000000000000000000011f000016f100000432000000000101041a000000000012041b000016eb00210425000016e600210423000016e100210421000000000112022f00000000021201cf000000f901100089000000000332022f00000000043401cf00000007031001bf0000061d03000041000016b60000013d0000000006250019000016bd0000813d000000000135004b000000000016043500000000060200190000006004000039000016bf0000c13d000016bf0000213d0000000005520019000000000542016f000000200400008a0000003f023000390000000503100210000016bf0000813d000006070210009c000016990000613d0000169a0000a13d000016750000613d000016760000a13d000016520000413d000000080110008c000016510000613d00000120051000390000010002100039000016520000613d000000080220008c000016520000a13d000000070320008c0000162d0000613d0000162e0000a13d000016090000613d0000160a0000413d000015e50000613d000015e60000a13d000015c10000613d000015c20000a13d0000159e0000413d0000159d0000613d0000010005100039000000e0021000390000159e0000613d0000159e0000a13d000000060320008c0000157a0000413d000015790000613d0000157a0000613d0000157a0000a13d000015560000413d000015550000613d000015560000613d000015560000a13d000015310000613d0000004005100039000000010220008c0000150e0000413d000000060110008c0000150d0000613d000000c0021000390000150e0000613d0000150e0000a13d000000050320008c000014ea0000413d000014e90000613d000014ea0000613d000000020220008c000014ea0000a13d000014c50000613d000014c60000413d000014a20000413d000014a10000613d000014a20000613d000014a20000a13d0000147d0000613d0000147e0000a13d000000040000000500000000020a00190000143c0000013d000000000a03c01900000000040760190000000004080019000000000464013f000000000700a019000000000964004b000005c10660019700000000080740190000000008000019000000000864004b000005c107000041000000000404043300000000067600190000000506a00210000000000474001900000004070000290000000004a2004b000014570000813d000000010a100039000000020310003900000000020604330000000102100039000014350000813d000014310000013d000000010310008a0000142d0000a13d000000000541004b0000000000a50435000000000525004b000000000528004b000013de0000013d00000000080504330000000000a80435000000000575004b000000000508043300000000085900190000145a0000813d000000000587004b0000141d0000813d000000000c17004b000013f40000013d000000010a000039000000010110008a0000140d0000c13d00000000050dc019000005c10cc0009c000000000cef013f00000000050c20190000000005ef004b000005c10fa00197000005c10e600197000000000d0ca019000000000d000019000000000d6a004b000005c10c000041000000000a0b0433000000000b5a0019000000050a100210000000000a18004b0000140a0000613d000000010aa00190000013de0000c13d000000000aa0004c000000000a0b6019000000000a0c0019000005c10aa0009c000000000ada013f000000000b00a019000000000eda004b000005c10d600197000005c10aa00197000000000c0b4019000000000c000019000000000c6a004b000005c10b000041000000000a0a0433000000000a590019000013f30000813d00000005097002100000000006050433000200000005001d0000000005650019000400000006001d00000020065000390000000101300039000000000128004b0000000008060433000300000006001d000000000132004b00000000011a0019000013c20000613d000000010500003a000000010120008a0000000102100270000013ae0000c13d000000020120008c000000050330008c00000000003a04350000133e0000c13d000005c107200197000005c1063001970000000003090433000000a009100039000000050230008c0000131b0000c13d000000070130008c000000020130008c000013030000c13d0000000803000039000000000412004b000000000334013f0000000002050433000005c10310019700000000010b0433000001000ba000390000137f0000c13d000000030120008c0000000000920435000012cc0000c13d000005c107900197000000000592004b0000000009030433000000a0031000390000000502b0008c0000000002b0004c000000020440008c0000000004010433000012b30000c13d000000000706a0190000000602b0008c0000000202b0008c000013660000c13d000000070120008c0000135a0000c13d000000050120008c000012dc0000413d000000000113001900000000008a04350000124c0000c13d00000000080904330000000409000029000000060230008c000200000009001d0000121a0000c13d00000000080b04330000000002090433000000c0091000390000000902a0008c0000000602a0008c000012010000c13d000000a0041000390000000502a0008c0000000202a0008c000000020b000029000000010c00002900010000000c001d000000040330008c000011df0000c13d0000008001a00039000000040210008c000011c70000c13d000005c1083001970000010003a000390000006002a00039000000080210008c000000030210008c00000000003b0435000011aa0000c13d0000000901000039000005c104300197000005c10120019700000000020b0433000001200ba00039000000400ca00039000012e70000c13d000012830000413d000000080120008c0000126a0000413d000000060120008c000300000005001d000000010440008a0000125c0000c13d0000000104200270000011880000a13d00050000000a001d0000002005a00039000000000a0100190000006004200039000011460000813d000006050420009c0000000404000029000011410000613d000000000201043b000000000141034f000011430000c13d000000000632004b0000001f0240003900000000042400190000000003230019000005c30540009c000000000551034f0000002005200039000005c20440009c000500000004001d000000000421034f000011430000613d000000000104c0190000000001008019000005c10530019700000000040120190000005f0430008c0000061c03000041000010d80000613d000000000353019f00000000034301cf000000000343022f0000010004400089000000000545022f00000000054501cf00000003044002100000000002520019000000000353034f000000000640004c000010b50000413d000000000773034f0000000008720019000010bd0000613d0000001f0450018f00000001050000310000000303000367000010cd0000c13d000010cd0000213d000005c30640009c000000000514004b000010cd0000813d0000001101000039000010900000c13d0000107e0000c13d000000000336013f000000000736004b000005c106100197000000000531004b00000000032300490000107e0000213d000000000212034f0000107e0000613d00000000050660190000000005070019000000000558013f000000000958004b000005c1055001970000000007064019000000000754004b000000000442034f0000001f0520008a000000000213004900000000041200190000000502300210000010810000813d0000061b0300004100000000022401cf000000000424022f00000000052501cf0000000003530019000000000454034f0000103d0000613d000000000620004c000010260000413d000000000774034f0000102e0000613d0000001f0250018f0000103e0000c13d0000103e0000213d000005c30740009c0000003f015000390000103e0000813d0000061a03000041000006170300004100000ffc0000a13d000006190110009c000006180120004100000fed0000c13d000006160300004100000fd30000613d000006150300004100000fc10000613d00000fb60000c13d00000fb60000213d000005c30620009c000000000552004b0000000002350019000000000552016f000000200520008a000000000236004900000f9c0000013d00000020066000390000000000860435000000000802043300000fa40000813d000000000857004b000000400630003900000f890000813d0000003402000039000000340530003900000060051002100000001a03000039000006130300004100000614030000410000000b0000000500000f670000613d00000612040000410000000804000029000000400130003900000f5f0000813d000006040130009c00000f6a0000613d00000f130000c13d000000e001200270000005be0320019700000ebc0000013d000000e002400270000000060400002900000000022400190000000a0400002900000eed0000813d00000f500000a13d000b0000000000020000000300000005000000e00110021000000611011001970003000000000002000006100300004100000e7a0000613d0000060f0300004100000e680000613d00000e5d0000813d0000003c020000390000003c053000390000060e0500004100000e4a0000613d00000e330000413d00000e3b0000613d000000000205001900000e260000613d000000000100043300000e2a0000613d0000008004000039000000f8025002700000004004300039000000600320003900000e260000213d0000060d0340009c0000004003200039000000030500003900000e260000c13d000000410330008c000000020500003916f10da40000040f16f10db10000040f16f10dbb0000040f000000210100003900000df00000613d00000de50000613d00000dda0000613d00000dd00000613d00000dd20000813d000000050210008c0000060c030000410000060b03000041000000800110003900000022030000390000060a0300004100000609030000410000001203000039000006080300004100000d950000613d000000000474019f00000000045401cf000000000454022f0000000006630019000000000464034f00000d840000613d00000d6d0000413d000000000884034f000000000983001900000d750000613d00000005062002700000001f0520018f00000d8f0000213d000000000335004b00000d870000c13d000000010770019000000d870000213d000005c30860009c0000000107004039000000000651016f00000d870000813d000000000214004900000d180000013d0000000000740435000000010700c039000000000770004c000000000702043300000d230000813d0000006004100039000000400410003900000cfb0000013d0000000304000029000300000004001d000000000112004900000d0e0000813d000000000114004b00000000023100190000002003200039000000000131016f0000001f01300039000000000132001900000ce20000013d000000000614001900000cea0000813d00000cdb0000213d00000cdb0000613d000000000300801900000000040320190000001f0410008c00000cc20000613d000200000003001d000000000431001900000c970000613d00000c7b0000813d000006060110009c000000400310003900000c700000813d000006040310009c00000c610000c13d00000c610000213d00000c4b0000813d000000600240003900000c3d0000813d000006050240009c000000000405043300000c260000813d000006040420009c00000060041002100000000000420435000000140400003900000c0d0000813d00000000020480190000000001048019000005be0510009c000005be0400004100000bf10000613d0000060301100041000005be0540009c000000000400041400000bdf0000613d0000801002000039000000000363019f00000000033501cf000000000636022f00000000063601cf0000000004480019000000000541034f00000bc50000613d00000bad0000413d000000000768001900000bb50000613d000000010800002916f116e80000040f000200000006001d00000b850000c13d0000000104006039000000000546001900000001060000290000001202000039000005ee02000041000000b30000013d000009d60000c13d000005ef0400004100000b650000c13d000005c603000041000000000034043900000005030000390000000000410439000000000053043900000260030000390000000000730439000000000501043300000240030000390000022005000039000000000056043900000200060000390000006005000039000001e00500003900000000006504390000000406000029000001c005000039000001a005000039000000000042043900000180020000390000002004000039000000000003043900000000020704330000000307000029000001000100003916f10c070000040f00000030021000390000000000360435000a00000006001d00000020061000390000001002000039000005c503000041000005c40210009c000000e002000039000000c0020000390000001602000039000005eb0200004116f110d50000040f000000010120018f000105be0030019d0000000d040000290000800902000039000005be0310009c00000ada0000613d000005fa040000410000001403000039000005c70300004100000aef0000c13d0000000000350435000005c30530009c0000000104004039000000000443016f0000003f033000390000000000040435000000000413001900000a720000013d0000000006740019000000000514001900000a7a0000813d00000008070000290000000102200210000000f80220018f00000a650000813d00000a680000013d0000000101400210000000000221016f000000030240021000000a4f0000613d0000001503000039000005ea030000410000001603000039000005fc0300004100000aa10000c13d000000030200003900000a0a0000013d000c00000004001d00000a570000813d000000000223016f00000a490000a13d0000001f0110008c16f110460000040f16f110890000040f000000000200041616f10d380000040f16f10d2a0000040f16f10d410000040f16f10e890000040f16f10c690000040f000005ed0400004100000ae10000c13d00000a3a0000a13d000009880000013d0000000003130019000000000334001900000007040000290000000503500210000000000353004b0000000003040019000009ae0000813d000000000125004b16f10ea80000040f0000096f0000013d0000000102200039000009fb0000813d000000000221001900000000033100190000001f033000390000000002004019000000200330008c00000005022002700000001f02300039000009fb0000413d000000200130008c000005b90000c13d000000010110018f0000001f0130008c000000000301c019000000000420004c0000007f0310018f0000000101100270000100000009001d00040000000a001d000005c30110009c000000800200003916f10d110000040f000005f403000041000008610000c13d000000000332004b000000010300c039000000000341004b0000001c03000039000005c903000041000009460000c13d000008fa0000613d000008e30000413d000008eb0000613d0000090e0000c13d000000090500002900000044040000390000090e0000613d00000004023000390000002404300039000005c2022001970000000000320439000900000004001d000005f3010000410000089a0000013d000000010110003900000000022500190000083d0000813d000000000245004b000b00000004001d000005ff01000041000900000005001d0000000b060000290000000705000029000005f6040000410000000303000039000005f5011001c70000000003018019000d00000005001d0000004002400039000005c40240009c000008a90000c13d00000000030004110000000002000412000600000005001d16f10d310000040f16f10c530000040f00000020025000390000000005006019000000000140004c0000000000150435000001000200008a000008950000c13d000000200530003916f116c70000040f000009440000c13d000000000232004b16f10d4a0000040f0000001003000039000005ca03000041000008fc0000c13d000600000002001d00000160020000390000000002270019000800000007001d0000800a01000039000005e701000041000006c60000013d0000081f0000613d000c00000005001d000006f90000613d000000000243001900000000026201cf000000000262022f0000010006600089000000000767022f00000000076701cf000000000705043300000003066002100000000005530019000000000252034f000006ee0000613d0000001f0640018f000006d60000413d000000000772034f000006de0000613d00000005054002700000000202500367000008150000813d00000000010004100000000e03000039000005f7030000410000084a0000c13d000000000130004c0000000401100370000000240210037000000000005104390000800201000039000005f801000041000005fe010000410000002201000039000008320000613d000000000331013f00000001030020390000001f0340008c000000000403c0190000007f0430018f00000001031002700000000000310439000005030000013d000000010200c039000d00000006001d000005330000613d000000040520008c00000001060000390000000001430019000000000161019f00000000015101cf000000000151022f000000000656022f00000000065601cf0000000006020433000000000121034f000005280000613d0000001f0540018f000005100000413d0000000007630019000005180000613d0000000502400270000009390000813d000400000008001d000700000007001d0000000001070019000000000141019f00000000011201cf000000000212022f000000000414022f00000000041401cf0000000003380019000000000232034f0000000503300210000004fa0000613d000004e30000413d000000000552034f00000000065800190000000505400210000004eb0000613d00000020082000390000001f0130018f00000000007204350000003f013000390000000503700210000005c30170009c00000601010000410000060204000041000000000223019f000000e0033002100000000703000029000700000004001d000005c40120009c000005e80200004100080000000c001d00070000000b001d000005c30510009c0000007f01a000390000000001a10019000000000026043500000000025201cf000000000252022f000000000262034f000003690000613d000003520000413d000000000882034f00000000098100190000035a0000613d0000000506a002700000006001400039000000000c020019000000000b0100190000001f05a0018f000000090a0000290000000c05000029000000400340003900000084010000390000006401100370000c00000003001d0000004403100370000000a00410008c00000020023000390000001001000039000005c502000041000005f00300004100000b410000c13d00000000010460190000000001050019000000000116013f000000000512004b0000000001310049000005c30230009c000000000302043b000000000443001900000000040560190000000004060019000000000447013f000000000847004b000000000643004b000000000332034f0000001f0420008a000009f00000c13d000000010110008c000009810000813d00000000020c043300010000000a001d0000000003c2004b00000000022c00190000011b02b00039000000dc02b00039000000bc02200039000000a80520003900000060047002100000000002b10019000000000262019f00000000022501cf000000000626022f00000000062601cf0000000004640019000000000565034f000002850000613d000000000820004c00000000070004110000026d0000413d000000000885034f0000000009840019000002750000613d0000000506b002700000000205500367000000c804c000390000001f02b0018f000000080b0000290000002001c000390000006801c000390000008801c00039000000a801c000390000005404c00039000000600110021000000000030004160000004001c00039000000000502043b0000000202a00367000000440a0000390000006004200210000000030c0000290000000000300439000005e803000041000000a4010000390000008401100370000500000003001d0000006403100370000000000630004c000000c00530008c000000040320008a000005e801000041000005fd0300004100000a1c0000c13d00000000040300190000000104500190000000000441004b000008da0000613d00000004040000390000015b0000613d000000040420008c000005f901000041000005c20110009c0000012d0000013d0000000205200367000009790000813d000000000532004b00000024022000390000000a06000029000000000615004b0000000005510019000000000551016f0000003f01400039000005c30130009c000000000113034f0000000001056019000000000714004b000000230420003900000004023003700000000002036019000000200420008c000000040210008a000000e40000013d00000000063400190000000005740019000007fc0000813d000000000524004b0000002007400039000000000445004b000000000532001900000140033000390000000000280435000b00000008001d00000000005a0435000000000685004b000000000558001900000000080a04330000000005b5016f0000003f05200039000005c30520009c0000012002300039000000000642004b0000013f0230003900000120042000390000014003000039000000b60000a13d000005c20310009c0000000001090433000000000103c019000000000100a0190000000003014019000000600320008c000000000151019f00000000011301cf000000000313022f000000000515022f00000000051501cf0000012004400039000000000343034f000000a50000613d0000008e0000413d00000000007604350000012006600039000000000763034f000000960000613d00000005042002700000001f0120018f00000000001a0435000000870000213d000005c00330009c000005bf031000410000000001b1016f000000200b00008a0000013f0120003900000000009a0435000000400a0000390000012009000039000005e60130009c000007d60000613d000005e50130009c0000079b0000613d000005e40130009c000001f60000613d000005e30430009c0000074b0000613d000005e20430009c0000070c0000613d000005e10430009c000006b70000613d000005e00430009c000006860000613d000005df0430009c0000065f0000613d000005de0430009c0000062d0000613d000005dd0430009c000001ce0000613d000005dc0430009c000001af0000613d000005db0430009c000006090000613d000005da0430009c000001820000613d000005d90430009c000005e00000613d000005d80430009c000001350000613d000005d70430009c000005c10000613d000005d60430009c000005980000613d000005d50430009c000005740000613d000005d40430009c000005510000613d000005d30430009c000004bf0000613d000005d20430009c000004a00000613d000005d10430009c000004810000613d000005d00430009c000004220000613d000005cf0430009c000003fe0000613d000005ce0430009c000003120000613d000005cd0430009c000000ec0000613d000005cc0430009c000002ea0000613d000005cb0430009c000000e0033002700000008005000039000000720000c13d000100000000001f000005be0030019d00020000000103550003000000410355000005be04300197000e00000000000202cf07cd008202ce07cc07cb07ca07c907c8008107c707c6005401b400e500b901b301b20133013207c507c407c307c207c107c007bf07be07bd07bc07bb07ba07b907b807b707b607b507b407b307b207b107b007af07ae07ad07ac07ab07aa07a907a807a707a607a507a407a307a207a107a0079f079e079d079c079b079a0799079807970796079507940793079207910790078f078e000a00190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b702cd000f00b700b600b5004c002300430013000d00090016078d078c078b00190008000a00b9078a078907880787078607850011000b004b000e0003000f000100050784078302cc078200e40781001d00e307800130077f077e00b4012f077d01b1077c012e077b01b0077a01af07790778005f02cb077707760775008002ca07740009077302c900e4077201ae07710008000a0770076f076e0001001e0005076d02c8006901ad0053076c076b0068076a002f012d02c701ac02c6012c02c501ab02c402c3005a000a0769002b0768004f07670766076507640763002f012b01aa004f012a007f076207610760075f075e075d005301a9075c004e075b075a075907580129012800e2075700190008000a0127075600e10755004e02c201ac01a8012601ab00b30754005a000a02cc0753005701a700530752006801a6002f012d001b01a50751012c02c1001802c007500008000a00b2074f0132074e004f0125074d01a4074c00140007074b074a002f012b01aa004f012a007f074901a302bf074802be02bd02bc0053012407470746074500e000e200df00b1074400190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d001707430053001400670742004300b0001a07410740073f009201a201a1005d0008073e00de02bb012301a002ba02b902b8073d001d019f019e004f073c007f073b00660043019d01b2007e007d02b70053004a005a073a003407390002003302b60002002e000c003200490002002d000500190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d000b007c0013000300010012001000220012002b0037002a007d00480042002a00550122002000af00230047000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700170738005800ae000e004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d001701210020007b000b02b500130037000300010012001000220012002b0003005c001a00090016073700910736001d019c0120073500dd009000dc00ad00ac000a02b4005f02b302b200530734005f00ab02b1005f07330732004d011f005300db019b0051019a07310052004d02b0005300b900db02af0730072f00aa00da00ae008f000e0199004c02ae001a007a000102ad02ac00a9000b00d9001302ab00030001001200100079006500780003000100120010002202aa001a007a000100d802a90014000700d702a800580077011e004c072e02a7072d072c072b072a002a07290728007600a9072707260080072500d60076072400e5072302a600760722000c07210720071f01a2071e071d011d071c001f0198071b071a0197011c00d501960719071807170716019507150714019402a50713071200e002a402a3071107100064070f070e070d0031070c0002070b0193070a00d402a207090708000902a101a7004f011b007f07070066004107060010008f011a00550059011902a0001a0192019100d300a8029f0705070407030127011800470702029e0701005f00680700002f012d01a500d206ff012c06fe01ae06fd06fc00a7000a01a906fb019006fa06f9005306f80117009106f7001d029d001b0116029c029b06f6001806f506f40008000a0077029a000806f300140007003406f20002003302990002002e000c003200a60002002d000500190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700510298005d011506f1000c06f00043000d0012008e00ab0013004106ef018f00230047000d0009001600190008000a00b9029700e106ee004e02c2001b01b101260018011402960008000a013302b4005f00ab02b2005306ed005f009202b1005f06ec06eb004d011f005300db019b00aa029506ea0052004d02b0005300b900db019b0066018e06e901a2018d029406e8018d06e706e606e506e406e30072011306e2011d06e1001f019806e006df0197011c00d5019606de029306dd019506dc0292018c02910290028f0057018b06db06da028e06d906d8018a028d008006d7028c0112028b028a001e011106d6004f00a5007f00120003007e000d06d506d4001002890110011a007100590119002a00a90288008d005c028700200059018902860001028502840020008c028306d30282001700ae000e004c02ae004a007a000102ad02ac011a00700075011902a0001a0065008b004900da01880041008f000100120010002202aa004a007a000100d802a90014001506d2004f0281019a00120003004800750042004a0192007d0187028006d10064008f00430020000b00a8007200030001001200100059002b027f06d0006906cf06ce0082005c00a40063001400070040005d00020075000c010f010e010d0186008a010c006f010b006200d100a3018506cd010a00890081010900140007001a000c00130009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b70108027e00b600b5004c01840020000c00130009001600190008000a002900280027005e00090026001b002100250018000d00240008000a0056018300570065001300370003000100120010002200510182000100a2027d027c000b00d9001a0003000100120010004a0065001a0003000100120010004a0065008b0023004100170001001200100051002000220088005500220181027b0092027a00370107002a027900480042005d00d6027800b30277007d00170180000100a20106001400070088001a005d00af00a10047000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001702a8005800ae000e004c002300430013000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001706cc005800ae000e004c002300430013000d0009001600190008000a01270276008f027506cb004f06ca06c9028c01120012002b0061019a017f001e0111019e004f00a5007f00120003005906c806c706c600b901130274027306c5004e06c406c306c200e001a3017e017d06c1002106c006bf06be06bd01b0018e06bc06bb005702cb06ba06b906b8004306b706b606b50272011e0110005000a00009027106b4007700ab017c00660069017b005206b301a806b2001d00e306b102700105010400b4026f06b006af00d006ae010306ad026e018c06ac06ab06aa004d018b06a906a806a7000306a6018a06a500b002a706a406a3001d002f026d026c06a200a90007001a010200cf01030004026b026a0088017a0023008c00030087000700ce00cf007400720061004a005a001e06a1000c00cd011e06a000190008000a002900280027005e00090026001b002100250018000d00240008000a005601830057006500130037000300010012001000220012002b0003005c001a0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00660101001700b800580131000e00b70108069f00b600b5004c01840020000c00130009001600190008000a002900280027006a00090026001b002100250018000d00240008000a001400070088000100220269069e069d01a8069c069b0009069a0699011b06980011000b0697000e0003000f0001000500190008000a002900280027006a00090026001b002100250018000d00240008000a0014000700170696005800ae000e004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a005600170052004d00510121069500580020004a01000694000f004c0012008e0008000100a200430013000d0009001600190008000a002900280027006a00090026001b002100250018000d00240008000a00140007001700b800580131000e00b70108069300b600b5004c002300430013000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a00560051005201320012026800aa004000da000200130037000c02980070001500a80010000b0020004a000c00010012001000220012002b0003005c001a0009001600190008000a002900280027026700090026001b002100250018000d00240008000a013306920057069101320690068f001400070034068e00020033068d0002002e000c003200490002002d000500190008000a002900280027005e00090026001b002100250018000d00240008000a00560052004d000b007c00130003000100120010002200510266000100d801060014000700170048004a0042002a00550122002000af00230047000d0009001600190008000a0127027600cc005c008d0272008f00500110068c00aa000900590271068b007100ab017c006600690265017b00b0068a068900d00688002f0179026406870130017800ff00fe06860685011d068401770683068206810680067f067e0057067d067c067b028e009f067a00fd0263007200cb06790072001d002f026d026500770007002300ce00cf026200fc006100510678017a004a0003008c005a0677002300cd067600190008000a002900280027005e00090026001b002100250018000d00240008000a0056018300570065001300370003000100120010002200510182000100a2027d0055000b007c001a0003000100120010002200510266000100d801060014000700170048004a0042002a00550122002000af00230047000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a027c000b00d9001300370003000100120010000e011300570065001a0003000100120010008b0023004100170001001200100051002000220088005500220181027b0092027a00370107002a027900480042005d00d6027800b30277007d00170180000100a20106001400070088001a005d00af00a10047000d0009001600190008000a002900280027026700090026001b002100250018000d00240008000a00560052004d001701210020007b000b00d9001300370003000100120010000f011300570065001a000300010012001000220012002b0037002a007d00480042002a00550122002000af00230047000d0009001600190008000a002900280027005e00090026001b002100250018000d00240008000a005600170052004d00510121067500580020004a01000674000f004c0012008e00430013000d000900160673067200fd06710670002b019902b700530261066f009e0034066e00020033066d0002002e000c003200490002002d00050014000700170075066c00230047000d000900160075002b0023066b00cf0015009d066a00140015003700ca000300b2066900230047000d000500a100c90668005a06670666011206650664017606630662000d0661001400070017008c066000230047000d0009001601880199065f00b80058065e00560017007d0100010800120088010000b600b5004c00120030007b065d00fb065c0020017600df01750072000c065b004f065a06590260009f007e01740010000b0020004a0003000100120010002a007100630087007b0012002b000300fa010e010d065800f901a0006f010b0062065700a306560655065406530089008101090001001e000900160652065100f8001d0650064f064e025f00510022010a01a900a10075064d00030055025e064c064b064a008000b000d300b800a00058001a005500b700a8027e00b600d700b502ab01740649004c00790282001a005d064800fc00a1025d005101730078004c00c80059064706460064064500030055018401b3064406430172064201a100c800080641025c025b017100140007017000e40640001d00e3025a02590105010400b4012f063f016f063e012e019000c7016e01af0258016d0057016c02570256016b006400de000501180086005a063d009e0034063c00020033063b0002002e000c003200490002002d000500de02bb012301a002ba02b902b8063a000902a1019e004f011b007f00660043019d01b20075002b009d000906390638000a005a0124001a018706370034063600020033016a0002002e000c003200490002002d000500140007001700590255063500230047000d0009001600500005063401910003010100a00633004f0169063206310001002202690630062f062e062d062c000100d8062b007a062a00ab0629062800f800130001001000f706270626062506240023062302740622009206210055007a062000010037001a0063001a061f061e061d0012008e00430013000d000900160168008c008d005000cc0009001d061c061b0092007000dc025f017c0082017b007700a4061a029a010a01870069061900cf06180617061600410008000100a2005d061500b4008c06140011000b002c000e0003000f00010005025400fb0613008702530012002b00370079007a06120048009c004200d6011702520002008000c60052025100fa016701660250024f0165006f0164006200d100a3024e0611024d024c00890081010906100017009c060f00200050005b000c00a9060e0079060d001a024b00a9060c00170022060b060a001a00630001001e0009001600140015003700ca000300b2060900230047000d000500040608060700f80013003700010010009c00f70606024a001a012400090014009200fb00700037006106050007060400b30063005d0249001a00b10181017e06030020000b0602012300aa0295000c006e000100da0010002201b40008060100a80007003406000002003305ff0002002e000c003201180002002d000500140007003405fe0002003305fd0002002e000c003200a60002002d000500040008000105fc0087000702a605fb02480247024605fa05f905f800790066010705f70079019405f60248024702460007011200b30063007c007905f50062001e006300700067007400150163004e05f4017d05f305f205f10129012800e205f005ef05ee000205ed016205ec02be02bc004e05eb05ea00c5004f0245007f05e9002b00100244003700030071028605e800740007003405e70002003305e60002002e000c003200490002002d00050020000b00700075000c0001008c0010002a0001006300a80007004000660002004a000c010f010e010d0186008a010c006f010b006200d100a3018505e5010a008900810109007c001700b0004a00cb05e4010f05e3010c00f6024305e2006605e1001d0089008202ce05e0016105df0017017a002005de0001001e000900160020024205dd0041024105dc0041002e000c024000780041002d000505db007d00710003023f05da00da000300550007007b023f00aa00c5016005d9015f004f006d009f004005d8000205d7000c0160008d05d605d505d4000c05d300fd05d20087001500140010002a0070023e002a05d1000c05d005cf00c805ce0255025d001a008e05cd05cc05cb05ca015e005d006905c905c805c705c6015e00a1006905c505c405c305c2015e05c105c005bf05be05bd05bc05bb015f05ba05b900160014000700170004010205b80048009c004200d6011702520002008000c60052025100fa016701660250024f0165006f0164006200d100a3024e05b7024d024c0089008105b605b50020024205b40041024105b30041002e000c024000780041002d0005015d015c023d023c023b023a0239023802370236008a023500f6015b015a05b202340009012505b10233009b003100cd0273004e05b0024505af016102320231005c01590006015805ae015c023d023c023b023a0239023802370236008a023500f6015b05ad05ac01620171017000e405ab001d00e305aa02700105010400b4012f05a90234016f05a8012e05a705a6016e02a505a505a400e0016c016d05a305a200f5016102320231005c015700060230008a022f006f00f9015600f40062016700f9015601640062024305a1015a00a505a0004d00060001001e0005008200fa059f059e016500f600f40061059d00a4015a00a5059c004d00060001001e0005059b059a0599006f00c40166059800f4026a022e023000f90156008a022f006f00f40062022d022c0597022b006e000300060011000b004b000e0003000f0001000500c300860596059505940163007605930592022a00c9002b00100244002b023e00060011000b004b000e0003000f000100050082022905910228000c00df017502bf0590058f058e009f007e001000060011000b004b000e0003000f00010005022c058d022b006e000300060011000b004b000e0003000f00010005022700d402a20061017f001e0111011f058c00a5058b006e000300060011000b004b000e0003000f00010005006e0268058a05890588000200060011000b004b000e0003000f000100050587058600060001001e0005022600910155001d019c01160120022500dd0224009000dc00ad00ac05850223005f01ad0222005005840221022200a400060001001e000501580583015400480042009c0192015f029400410080022801570006022600910155001d019c01160120022500dd0224009000dc00ad00ac05820223005f01ad02200125005000c70221022000a400060001001e0005002a029700e10581004e0580001b01b1057f0018011402960008057e00560052004d011f057d00db02af00060001001e00050067000200b1004e017d057c021f00e2057b01290128057a0579018a057800d4057700610006015300a000070003057600d300c20575021e004e01720574057300c6057200430004005000a00007021d0571018f057000a6017e0249002a056f005c0152000600c100760151056e00df056d002f00fe056c00b1056b056a001f0569056800ff00e2056705660050000c000d00b3021c0006006500130003006e000100100006021b0013000c0040000d018f0006007b000b02b500130003006e000100100006007b000b00d900130003006e000100100006021b0013000c0040000d021c0006012401500565021a01a40564022901600292029c001f0563056205610560055f0128000c021f055e055d055c02190218055b011d055a001f0198055905580197011c00d50196055702930556019505550554018c02910290028f009b018b0553055205510217026e00fd00060011000b004b000e0003000f000100050001001e0005000805500006005400070034054f00020033054e0002002e000c003200490002002d000500c0054d0002006d054c00020040054b00020013000c054a0006006d054900020040021600020013000c00f30006006d05480002004002b600020013000c00f30006015d054705460182054502150544029f0543009a0542015900060011000b0541000e0003000f0001000500540015009900ca000300b20540014f0047000d000500540015009900ca000300b2053f014f0047000d000500540015009900ca000300b2053e014f0047000d00050158053d008e053c0009053b053a0539018e0538000905370536021400b1002b00c3021e00690213021705350064053402800064004300f800b0008b05330212001d01a100080532053102610009014e05300082001d000d052f01570006025c025b017100c60007017000e4052e001d00e3025a02590105010400b4012f052d016f052c012e019000c7016e01af0258016d0057016c02570256016b006400de0005002a00c1014d0115052b00e5052a009f0529004102110528021000640086001000060011000b004b000e0003000f0001000500080527000600540007003405260002003302990002002e000c003200490002002d0005000805250006005400070034052400020033020f0002002e000c003200490002002d0005015d01540048004200bf0003015900060523021200d7002b0099002200bf027f00990522020e005b0063017200500007052100bf020e005b006305200006051f008f00070215051e00a00168008d0004016800cc007c00d70123020d005400d3004801540009000400fb051d0077000700ce014c026200400077024a00610007000b0074005b000c0001009c01880010002200820087000700720102014c00c600a402b3004201180059051c051b051a00030071000700ce014c0071001200610519000c00cd05180087020c002a0048004201100071020c008d0077025301b4000b0074005b000c006e0001026b0010002200590517002a051602c800ce0515004800cc0042008d007100fc00420059007a05140072008e0513051205110003004800fc017400420510011700c8000200cc00800014000b0074005b000c0001007200100059024b00700007004000c80002011e000c010f010e010d0186008a010c006f010b006200d100a30185050f026000890081050e0014050d00060011000b002c000e0003000f00010005005400070034050c0002003302160002002e000c003200490002002d00050011000b004b000e0003000f000100050001001e0005007000070034050b00020033050a0002002e000c003200a60002002d0005050900c1014d011500e50508009f0507004102110506021000640086001000060011000b004b000e0003000f00010005002a00c1014d0115017600e50151050501a30213001f0504050300b10502050100d5050004ff04fe04fd018d022701a404fc04fb04fa001d019f04f904f8020b04f700640086001000060011000b004b000e0003000f00010005000804f6000600540007003404f500020033020a0002002e000c003200490002002d0005000804f4000600540007003404f300020033020f0002002e000c003200490002002d00050015019d04f20050001504f104f004ef00480042000600540007003404ee0002003302090002002e000c003200490002002d000500540007003404ed0002003302090002002e000c003200490002002d0005002a015004ec020804eb00d4020700c3010100c701a6002f012b04ea04e9012a04e800c9000c04e7021802bd0219020600d004e6002f0179026404e50130017800ff00fe04e404e304e2017704e104e00194021404df02a3009b02a404de04dd016b004100060011000b004b000e0003000f00010005006d04dc00020040016a00020013000c00f30006010704db04da04d9011a04d804d7029e04d6009b003604d5001f04d404d3003504d2020504d1009804d004cf008504ce028b04cd005701a704cc04cb0050009104ca001d029d012004c904c8029b04c7009000dc00ad00ac04c600060001001e00050011000b002c000e0003000f000100050061017f001e011100a504c500060011000b04c4000e0003000f0001000502cd00de009d0204015004c3021a00d4020700c3010100c704c2001d019f04c104c0020b04bf00c9000c004004be04bd04bc020600d004bb002f017904ba04b90130017800ff00fe04b804b70204017704b604b504b4015104b304b2005f04b104b004af04ae000200060011000b004b000e0003000f00010005000804ad000600540007003404ac00020033020a0002002e000c003200490002002d0005015300d302ca04ab004e04aa04a900d004a8009804a7000804a6013304a5009b04a404a30203022a023304a204a100e00097009b04a00203049f049e049d0068049c002f012d01ac00d202c6012c02c501ab02c402c3005a049b049a04990175011900d7000400780283002a01730007000800010498009900c30086028104970076000201630162007604960495049400c9002b00100289005b0288020d005c02870074007b00790102000102850284007c00bf015200060001001e00050011000b004b000e0003000f000100050153049300be0202049204910490048f0081048e00970201048d02630060001e048c014b00f700690200009601ff0096010300a601fe00c200c4002b01fd014a0090000900ad01fc01fb01fa000701f9009801f801f701f601f500bd008501f401f300f201f201f100f2018901f001ef00c40149048b0191048a0489048802020487048604850484048301ee0482006801a6002f01ed02c101ec004e01eb001801ea048100a70480047f009e0148001c0193009e047e001c047d001c047c0030047b021d0069006801e9002f00f102c7047a00bc00f000ef00ee00ed0085047900740076009e009a001c0002009e0478001c01e8001c0477006701e7007e00680147002f00f100d2014600bc00f000ef00ee00ed0085047600f501450475001c000c006001690474008404730472000401e60471001c0470001c01ee046f007e00680147002f00f100d2014600bc00f000ef00ee00ed0085046e00f5006701e5001c019301e6046d001c046c001c046b046a046900e101e4004e01e301e201e101e0012601df0098014400ac046801de001500bb001c011c046700ba00040143000401dd000401dc000400ec000400840004006c000400eb00040143000400950004009401db000400670466001c01da001c00be0465046400e101e4004e01e301e201e101e0012601df0098014400ac046301d9001500bb001c046201d80004006b00040083000400ea000401dc000400730004008400e9005b00e802010060001e001d014b00f7008601d7009600c2046100500007014901b30460045f045e0060006b0004008300040094000400ba00040095000400ec0004006c000400730004006b00e9005b00e80097045d045c0060006b00040083000400ea000400ba000401d8000400eb000401dd000401d6045b001c045a001c006d003000e7003f0036003e001f04590035003d003c0205003b003a003900380458003104570456001c000201d6045501420454001c0078002b0453045200910451001d01d50116045001d400dd01d301d201d100a7044f00410015005a01420078044e01d0000400ec00040095000400940004006c000400730004008400e9005b00e8044d044c0060006c0004006b0004006c005b00e900e8044b044a04490097044802c9006801e9002f01ed04470446004e01eb009001ea044500a7044401de00be005a01420078000301450443001c0442001c028d006701e7007e00680147002f00f100d2014600bc00f000ef00ee00ed0085044100f5014501e5001c000c0060016901d000040083000400ec01db000400670440001c01da001c043f043e00be00910155001d01d5043d043c01d400dd01d301d201d100a7043b043a00670439001c01d9006b000400ea0004006c000400730004008400040143000400eb000400950004006b00040083000400ea000400730004008400040083014100970060006c0004007300040094000400ba0004006b01410060006c000400730004008400040094000400eb0004009400040095000400ba00040095000400830004006b0004007301410438043700970060006c000400670173043604350200009601ff0096010300a601fe00c200c4002b01fd014a0090000900ad01fc01fb01fa000701f9009801f801f701f601f5043401f401f300f201f201f100f2018901f001ef00c4014901800433025400be01d7009600c2043200500007015200060011000b002c000e0003000f000100050011000b007c000e0003000f0001000502cf026c04310114014001cf015c0430042f042e0093042d00bd042c0208042b042a04290428027500d500bc0427042600c5042504240423042204210420041f041e041d041c041b041a041904180417041601400415041404130093041200c504110410040f040e040d040c040b040a0409001d040804070406040500850404040304020401040003ff03fe03fd00c503fc03fb01ce00bd013f03fa009303f900bd03f803f703f60093014e013f01ce00bd013f03f50093014e03f403f303f203f1013e03f0028a013e03ef03ee02c0001d014b013e00bf005a014001cf03ed03ec03eb01ec03ea03e90093012503e803e703e603e5012903e403e303e203e103e003df01a503de03dd03dc01ae03db03da00a703d900cd03d803d703d600060011000b002c000e0003000f00010005001500e603d500bb01cd00c0003000e7003f0036003e001f00460035003d003c0045003b003a0039003803d400310007009a01cd000200060011000b002c000e0003000f00010005001501cc03d300cb03d201cb003001ca003f0036003e001f00460035003d003c0045003b003a0039003803d10031000701c903d0000200060011000b002c000e0003000f000100050015009d01c800cb03cf00400030013d003f0036003e001f00460035003d003c0045003b003a0039003803ce00310007000801c8000200060011000b002c000e0003000f00010005001501c703cd03cc03cb006d003001c6003f0036003e001f00460035003d003c0045003b003a0039003803ca00310007014803c9000200060011000b002c000e0003000f00010005001503c803c700bb03c603c50030013c003f0036003e001f00460035003d003c0045003b003a0039003803c40031000703c303c2000200060011000b002c000e0003000f000100050015009d013b03c1013b0040003003c0003f0036003e001f00460035003d003c0045003b003a0039003803bf003100070008013b000200060011000b002c000e0003000f00010005001500e603be01c503bd00c00030013d003f0036003e001f00460035003d003c0045003b003a0039003803bc00310007009a03bb000200060011000b002c000e0003000f00010005001501c403ba01c303b901c2003000e7003f0036003e001f00460035003d003c0045003b003a0039003803b80031000701c103b7000200060011000b002c000e0003000f00010005001503b603b5013a03b403b3003003b2003f0036003e001f00460035003d003c0045003b003a0039003803b10031000701e803b0000200060011000b002c000e0003000f00010005001501cc03af00bb01c001cb003000e7003f0036003e001f00460035003d003c0045003b003a0039003803ae0031000701c901c0000200060011000b002c000e0003000f00010005001500e603ad01c301bf00c0003001ca003f0036003e001f00460035003d003c0045003b003a0039003803ac00310007009a01bf000200060011000b002c000e0003000f000100050015009d01be01c503ab0040003001c6003f0036003e001f00460035003d003c0045003b003a0039003803aa00310007000801be000200060011000b002c000e0003000f00010005001500e603a9013a01bd00c00030013c003f0036003e001f00460035003d003c0045003b003a0039003803a800310007009a01bd000200060011000b002c000e0003000f00010005001503a703a603a503a403a3003003a2003f0036003e001f00460035003d003c0045003b003a0039003803a10031000703a0039f000200060011000b002c000e0003000f00010005001501c7039e00cb01bc006d0030013d003f0036003e001f00460035003d003c0045003b003a00390038039d00310007014801bc000200060011000b002c000e0003000f00010005001501c4039c013a01bb01c20030013c003f0036003e001f00460035003d003c0045003b003a00390038039b0031000701c101bb000200060011000b002c000e0003000f00010005039a0399039803970396039500c1007e0394026f002f012b01aa0393012a039200df03910390001d038f038e038d025e038c0114038b005c00060011000b004b000e0003000f00010005006d038a00020040016a00020013000c00f3000601b00389014a03880387011b00090144038603850384015b00060383008b0006001e00060382008b0006001e00060381008b0006001e000603800006037f0006037e022e022d000000000000000000000000000001390044004400440000004400440044037d037c00000000000000000139004400440000000000000044000000000000037b0138037a000000000379000000000000037803770376000003750000000000000374037303720371037001ba00000000000000000000036f000000000000036e000000000000036d000000000000036c000000000000036b000000000000036a0000000000000369000000000000036800000000000003670000000000000366000000000000036500000000000003640000000000000363000000000000036200000000000003610000000000000360000000000000035f000000000000035e000000000000035d000000000000035c000000000000035b000000000000035a0000000000000359000000000000035800000000000003570000000000000356000000000000035500000000000003540353035203510350034f034e034d034c034b034a03490348034703460345000001b9034403430000013700000342000003410340033f033e033d033c01b80000033b033a033903380337033603350000013900440044004403340333033203310330000000000000032f032e032d032c01370000032b0000032a032903280327013801b7000000000326032503240323032200000000000003210320031f031e0137000000000000031d031c01b70000031b031a01ba00000319031803170316031503140313031203110000000000000310030f030e030d030c030b030a0309030800000000000000000000000003070000000000000306000003050000000000000000030400000303030201b800000301000000000000013601350134030001360135013402ff013601350134000002fe004402fd02fc02fb02fa02f902f8013802f702f6000002f502f402f302f202f100000000000002f002ef02ee02ed01b601b501b902ec02eb02ea02e902e802e702e602e5000001b601b502e402e302e202e102e0000002df00000000000002de00440044004402dd02dc02db000002da02d902d802d702d602d502d4000002d302d202d102d0000000000000000000000000000000000000000000000000000000000000", - "logIndex": 33, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353 - }, - { - "transactionIndex": 3, - "blockNumber": 314845, - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "address": "0x0000000000000000000000000000000000008004", - "topics": [ - "0xc94722ff13eacf53547c4741dab5228353a05938ffcdd5d4a2d533ae0e618287", - "0x0100061f04f8ac19b027b4df36f13d2566f46cbfd1a9e0a6669dbb2e33877e0f", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 34, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353 - }, - { - "transactionIndex": 3, - "blockNumber": 314845, - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0100061f04f8ac19b027b4df36f13d2566f46cbfd1a9e0a6669dbb2e33877e0f", - "0x000000000000000000000000ac26e0f627569c04dae1b1e039b62bb5d6760fe8" - ], - "data": "0x", - "logIndex": 35, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353 - }, - { - "transactionIndex": 3, - "blockNumber": 314845, - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x0000000000000000000000000000000000000000000000000027f35d17e35c80", - "logIndex": 36, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353 - } - ], - "blockNumber": 314845, - "confirmations": 577, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0ee6b280" }, - "status": 1, - "type": 113, - "l1BatchNumber": 3353, - "l1BatchTxIndex": 103, - "l2ToL1Logs": [ - { - "blockNumber": 314845, - "blockHash": "0xea44ab5568365ff51b0bc7ae51ba1341b65d0996f14225b6eb2a3d475de0728f", - "l1BatchNumber": 3353, - "transactionIndex": 3, - "shardId": 0, - "isService": true, - "sender": "0x0000000000000000000000000000000000008008", - "key": "0x000000000000000000000000000000000000000000000000000000000000800e", - "value": "0x3bb7506038cd0b0f3ca1d4115458116a3836ebff61fc8355f338d42b0a5be957", - "transactionHash": "0x33f2d4d14d444cfb24332cabcc43eab60ce1bcf70b6a8d9bf35b910a5d57c4be", - "logIndex": 0 - } - ], - "byzantium": true - }, - "args": [ - "0x0c150b404A639E603639b575B101B38B64e12D0b", - "Api3ServerV1 admin", - "0x1e0cd5CDB3a7bc2Db750aBc12FeeD05CA94e90ab" - ] -} diff --git a/deployments/zksync/ProxyFactory.json b/deployments/zksync/ProxyFactory.json deleted file mode 100644 index f0bc4a47..00000000 --- a/deployments/zksync/ProxyFactory.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "address": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "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": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "receipt": { - "to": "0x0000000000000000000000000000000000008006", - "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", - "contractAddress": "0xFAF0129B9C1fA35C8a9B1e664Dd6247aE624C002", - "transactionIndex": 7, - "root": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "gasUsed": { "type": "BigNumber", "hex": "0x01792476" }, - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "logs": [ - { - "transactionIndex": 7, - "blockNumber": 520324, - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x0000000000000000000000000000000000000000000000000000000000008001" - ], - "data": "0x00000000000000000000000000000000000000000000000000213752be3d8380", - "logIndex": 32, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104 - }, - { - "transactionIndex": 7, - "blockNumber": 520324, - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "address": "0x0000000000000000000000000000000000008008", - "topics": [ - "0x3a36e47291f4201faf137fab081d92295bce2d53be2c6ca68ba82c7faa9ce241", - "0x000000000000000000000000000000000000000000000000000000000000800e", - "0x9fd7af3b8cde88e76e27fe4a2a0f609dab94072dd3f81d78ec3e5e2e8b3fef20" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000020f202790000000000000000000000000032043500000000010000190000000002010433000000000012043505f6046f0000040f000000000110004c000000000001042d05f604cb0000040f00000000002104350000046c0000c13d0000017f0420009c00000007010000290000018101100197000000010100c039000000000112019f00000000020380190000002001100039000000080100002900000000020000190000000000230435000000000210004c05f604c10000040f000000040200003900000000030000190000000001000416000000000104001900000006010000290000002003000039000000240200003905f604860000040f0000000001000031000000000014043500000000001304350000000803000029000000070200002905f6057e0000040f0000000003000031000800000003001d000000000101043300000020020000390000000001030019000000000301001905f605ec0000040f00000194011001c7000000000200041400000000010380190000017f0410009c0000017f03000041000000000871001900000020032000390000004f0000213d0000000503000029000400000001001d000700000003001d0000000802000029000600000002001d0000010003300089000000000404043b0000000303300210000000200300008a0000000000010439000000000101043b000000c002200210000000400220021000000002044003670000000403000029000700000002001d0000002002400039000500000001001d000500000003001d00000000033401cf000000000434022f000000000630004c000000010660003900000005076002100000000006000019000000410100003900000000001004350000019b0100004100000024010000390000000000120439000000000100041200000000001004390000018e0100004100000000005304350000000101200190000000000303043b0000000102200190000100000003001d0000046c0000613d000700000005001d00000003030000390000800d020000390000006001100210000000000131016f000000000001043500000000019100190000000007a6004b0000000000780435000000000707043b000000000774034f0000000006a0004c000000050a900270000000400120003900000181051001970000001f0390018f00000000009304350000000002050433000000080500002905f604950000040f0000002401200039000001930120009c05f6053a0000040f000600000004001d00000006040000290000000002010019000000050100002905f605d10000040f05f605130000040f000000000202043305f6054c0000040f0000019001000041000000a001000039000000a0024000390000008003400039000000600240003900000040034000390000000004030433000000000200041005f605680000040f0000000000020439000000000023043900000004030000390000000002000412000000000020043900000000030304330000018e020000410000000401000029000000030100002905f605bf0000040f000700000001001d05f604f00000040f0000006402000039000000040210003900000184020000410000002402100039000000440210003900000000020400190000004001000039ffffffffffffffff0000004002000039000000600220021000000040011002100000000007610019000000000464034f0000000002030019000200000002001d000003f30000613d0000008403400039000000a4024000390000000304000029000300000001001d000300000003001d0000000602000029000400000004001d000000040400002900000007030000290000000502000029000000000302043300000000040000190000018003000041000000000363019f000000000636022f00000000063601cf000001800110009c00000180011001976f0000000000000000000000ffffffff000000010200003900000000070000190000019e0310009c000005370000213d000000000402001905f604d40000040f000000040110003900000000010360190000000003008019000000000510004c0000000004032019000000040120008a000004ed0000213d000005f800010430000005f70001042e000000c0011002100000017f0320009c0000017f0100004105f605f10000040f0000000000310439000000000500001900000000010504330000000706000029000000000037043500000000060704330000000506a0021000000005040000290000000609000029000001920120009c0000000705000029000000000204043300000008040000290000007f0190003900000060012000390000004003200039000000e403000039000000c40240003900000002040000290000019102000041000600000003001d000500000002001d0000005f019000390000000000380435000000000373019f000000000737022f00000000073701cf0000000007080433000000000474034f0000000507a002100000000709000029000000c40300003900000197020000410000019902000041000000200120008a000000000231004905f605e30000040f0000000203000029000000020100002900000000003404350000000402000029000001810110019800000000010200190000018f020000410000006002000039000400000002001d000000000042043505f6055a0000040f0000000000240435000400000003001d00000020034000390000000004020433000000000808043b00000002010003677a65726f0000000066696369617279204f45562062656e6565207a65726f000064415049206e616d0000000000000001ffffffffffffffc0ffffffffffffff4064204944207a657244617461206665659b89c0d60f4f9f5762e1cd30555d1665431b1770c5bc0ddd3cda33511d41a8a5000000440000000002000002000000004e487b71000000005a220f5afb37aedd816845087d314951303eb8db83942ff831d654553da13df726c1f7886822cb4dcd770e93f86d9ec4c5a363e8de8e0a9f010000833ea8eec6abc9b11b922fa94375dfb475f5e197f9addaf0c5f3e354d09a2a9d77287e93a20666cf7472ed718180c036fe00b90b1b3722b686ce72da1b01000071aa077a2bb0a78bc565644d4e26ccc15a6978a90afef69474bc2bfb3cff915717e95cf852f08c7d327b623d1dc00cf2f5e14d69b02469e3d61a28f2225212a04ae578b0430200000000000000ffffffffffffff7bffffffffffffffbfcb54e6f31e139cc01af290912837797875d77acc93c6b6e6010000832145787c7fc7c103c00ca494dd8520db7e2c088b06188af794c2fb302020dba91b30cc004ae314721c4cfd502fcc1ae0c45e3addf26d36ffd29dbe56010000718e160c49ab882de59d99a32eff553aecb10793d015d089f94afb7896310ab089e4439a4c000000002d6a744e00000000d67564bd000000009ae06c84000000008dae1a47000000007dba7458000000006c9d6c09000000005849e5ef0000000050763e8400000000da1b7d0f08c379a00000000072657373207a65726572563120616464417069335365727600000002000000008000000000000000000005f600000432000005f400210423000005ef002104210000006001100039000001810220019700000020041000390000000000450435000000400510003900000181044001970000001403000039000001a403000041000005d40000613d0000000e03000039000001a303000041000005c20000613d000000000002043500000000022300190000000000460435000000000474019f00000000045401cf000000000454022f0000010005500089000000000757022f00000000075701cf0000000007060433000000030550021000000000066300190000000506600210000005b10000613d000000000750004c0000059a0000413d000000000867004b00000001077000390000000000890435000000000884034f00000000098300190000000508700210000005a20000613d000000000760004c000000050620027000000020031000390000001f0520018f000005bc0000213d000000000335004b00000000054200190000000000650435000005b40000c13d0000000107700190000005b40000213d0000019e0860009c0000000107004039000000000716004b00000000066100190000004005000039000000000651016f000000200500008a0000003f01200039000005b40000813d000001a20120009c0000000004010019000005760000c13d000005760000213d0000000102004039000000000221004b0000000001120019000000000232016f0000001f022000390000004001100039000005600000813d000001a10210009c000000c001100039000005520000813d000001a00210009c00000011030000390000019f030000410000053d0000613d000000020000000500000001020000290000004401100370000001810330009c0000002403100370000200000003001d0000000403100370000005370000613d0000005f0410008c00020000000000020000000100000005000000000304001900000001010000290000000403300370000005100000213d0000019e0410009c00000024013003700000000203000367000005100000613d0000003f0410008c0001000000000002000000000224004b00000000043100190000019e0430009c0000000203100367000004ed0000613d000000000330004c00000000030460190000000003050019000001800330009c000000000363013f000000000400a019000000000763004b000001800330019700000180062001970000000005044019000000000523004b00000180040000410000001f0310003900000000012100190000000002048019000000000131001900000000010480190000017f0510009c0000017f040000410001017f0010019d00000060011002700003000000010355000004c00000013d000004bc0000613d0000800602000039000004b80000013d0000000003060019000000010500003900008006040000390000800902000039000004b60000613d000000000260004c000000000121019f00000000010740190000017f0370009c000000000223019f000000600330021000000000030180190000017f0430009c0000000002018019000000000041043500000004012000390000019d01000041000000000051043500000060050000390000004401200039000000000015043500000000070004140000006405200039000000840130008a0000000006010019000004920000613d00008005020000390000019c011001c70000000001024019000004830000613d00008010020000390000019a040000410000044a0000613d000004330000413d0000043b0000613d000001820300004100000000003404390000012004000039000000010300003900000100010000390000016001000039000001400100003900000080020000390000000102000031000000000252019f00000000023201cf000000000232022f000000000202043b000000000535022f00000000053501cf00000000050404330000000004410019000000000242034f0000000504400210000004120000613d000000000530004c000003fb0000413d000000000645004b00000001055000390000000000670435000000000606043b000000000662034f0000000506500210000004030000613d000000000540004c00000005044002700000001f0340018f00000001040000310000000302000367000004220000c13d0000000103000029000000060300002900000040024000390000000704000029000600000001001d0000019504000041000002d60000613d000002bf0000413d000002c70000613d000000030300002900000084043000390000000104000029000000a40230003900000196040000410000024a0000613d0000000406000029000002320000413d0000023a0000613d000700000004001d0000019804000041000001c00000613d0000000506000029000001a80000413d000001b00000613d000300000002001d000200000001001d000200000004001d00000020023000390000004002300039000300000004001d00000019030000390000018303000041000004140000c13d000000000230004c0000046c0000213d000001810230009c000000a002000039000000000220004c0000000002036019000001800220009c000000000300a019000000000520004c00000180022001970000000004034019000000200420008c00000000003504350000000006050433000000a005500039000000000454034f0000000505500210000000760000613d0000005f0000413d000000000756004b0000000000870435000000a007700039000000000874034f000000670000613d000000000650004c000000050520027000000002040003670000001f0320018f0000000000310435000000570000213d0000009f0130008c000000000331016f000000bf0120003900000000020000310000018102100197000800000005001d0000000001026019000000000200a019000000000410004c0000000003024019000000000310004c00000180020000410000000001100031000000040100008a0000018d0110009c000002f80000613d0000018c0210009c0000026b0000613d0000018b0210009c000001e10000613d0000018a0210009c000001640000613d000001890210009c000000fa0000613d000001880210009c000003a40000613d000001870210009c000003510000613d000001860210009c000000960000613d000001850210009c000000e0011002700000046c0000413d000000040110008c00000040030000390000008005000039000000460000c13d000100000000001f0000017f0030019d000200000001035500030000004103550000017f0430019700000060033002700008000000000002000400000000000202780277002a02760275027402730272027100560270026f026e0055001f026d026c00fb003e026b026a0269026802670266026502640263026202610260025f025e025d025c025b025a000a00190006000a02590258025702560018025500b00254025300af002902520006000a005400530052001700510050003d0251001e02500012000900280018001600190006000a024f024e003c024d024c024b004f004e004d00170004001d000200080095024a02490248024702460245004c004b024400fa02430242004a024102400049023f023e023d003b023c023b00ae00ad003a00390048004700ac023a00ab023900aa02380237023602350234009402330232000a023100a90230022f022e022d00270093022c00010092022b0001009100090090001c0001008f000800190006000a001f0026008e008d0038004600150002000e008c0025001b00a80024000300110005003700f9022a00f800f7002300140028003800f60045001a00f5008b0003008a000500890022008800360087008600850084001d00830035001e00a7022900a600f4000d022800f300040012002100f200290082000c0003008a000500810022008000a5007f0014007e0034000100f1007d0014007c0004007b0020007a004400430004001a0079008a0003000c000500370078000d000400f000a40018001600190006000a001f00260077008d0038004600a500150002000e008c001b00ef0002000e00760025007500ee0024000300110005001c0046003700f9022700ed00f800a3002300140035001a00f500ec0003008b000500890022008800360087008600850084001d00830226001e0074000c001100a200eb007300ea00a700e900e8002100290082000c0003008b00050081002200800072007f0014007e0042000100e7007d0014007c0004007b0020007a004400430004001a0079001b0003000c000500370078000d000400f000a80018001600190006000a001f0026008e00380036004500060002000e00710025001b00230024000300110005002a0012000300700033006f022500e60009005400530052001700510050003d00f7001e00a100a000340001000d009f0094002100e5000200a6006e006d0015009e006c001c0001003200e4006b006a0069006800730041006700660224004c004b0031006500640063004a0062022300490222022100e300e20031003b00e100e000df003a00390048004700de00dd0061006000dc003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c0220005b002b00560012005a00270023000900280018001600190006000a001f0026007700db00da021f003500060002000e00710075000d004500060002000e00760025001b00230024000300110005002a0012000300700033006f009d00d90009005400530052001700510050003d00a3001e00d800d70034000100a000420001000d009f0094002100d6000200a1006e006d0015009e006c003200550034000100d500e4006b006a006900d40073004100670066021e004c004b0031006500640063004a0062021d0049021c021b00e300e20031003b00e100e000df003a00390048004700de00dd0061006000d3003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c021a005b002b00560012005a00270023000900280018001600190006000a001f0026008e008d00db00da00150002000e008c0025007500a4002400030011000500d200d1001c00a30001003200d00055003500cf003300680020007800290005002a0012000300700033006f009d00f10009005400530052001700510050003d0059001e00eb0219021800f4000d0217009c002000e5000200a6006e006d0015009e006c02160001003200ce006b006a0069006800cd0041006700660215004c004b0031006500640063004a006202140049021300cc009b009a003b00cb00ae00ad003a00390048004700ac00ca0061006000dc003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c021200c9005b002b00560012005a00270023000900280018001600190006000a001f0026007700450038003600a500150002000e0071001b00ef0002000e00760025000c00ee002400030011000500890022008800360087008600850084001d00830035001e0074000c001100a20034007300ea00a700e900e8002100290082000c0003008b00050081002200800072007f0014007e0042000100d9007d0014007c0004007b0020007a004400430004001a0079001b0003000c0005003700a9000d0021002800290018001600190006000a001f0026008e02110043004600150002000e00710025000c00a8002400030011000500890022008800360087008600850084001d00830045001e0210020f020e0001000d0044003800040012002000f2001a0082000c0003001b00050081002200800072007f0014007e0034000100e6007d0014007c0004007b0020007a004400430004001a0079001b0003000c0005003700a9000d0021002800290018001600190006000a001f00260077008d00f30046007200150002000e008c008a000d003500060002000e00760025007500a4002400030011000500d200d1001c0001003200d0005500a200cf003300680020007800290005002a0012000300700033006f009d00e70009005400530052001700510050003d0059001e00d800d70042000100a0020d0001000d009f0094002100d6000200a1006e006d0015020c020b020a020900c802080207020600c70205009a0204020302020201020001ff01fe01fd01fc01fb01fa003b01f901f801f701f6003901f501f401f300f601f2000801f1000101f0003d01ef00c6001c01ee00c601ed01ec01eb01ea0016006c003200550042000100d500ce006b006a006900d400cd00410067006601e9004c004b0031006500640063004a006201e8004901e700cc009b009a003b00cb00ae00ad003a00390048004700ac00ca0061006000d3003c005f0030000b00100040002f002e005e000f002d000b0010003f000f002c005d005c01e600c9005b002b00560012005a0027002300090028001800160002001300080030002f002e0099000b00100098000f002d000b0010003f000f002c01e500c5005801e4003e000700020013000800c4002d00c301e300c201e201e100c5005801e0003e000700020013000801df01de01dd01dc01db01da01d901d801d7000401d601d500c4000b01d4004001d301d201d101d001cf01ce00c201cd002c01cc01cb01ca01c901c801c7002b01c601c5002b005801c4003e01c301c201c101c00002000701bf01be01bd009901bc00c301bb009801ba00c10030000b0010002f002e00990098000f00c001b901b801b700c701b601b501b401b301b201b101b001af01ae01ad01ac01ab005701aa00bf001101a901a800bf009c000700020013000801a7007400be00ab01a600aa00bd00b000bc00bb00af001a00ba000601a501a401a3003e01a201a101a00057005900b900b8002a00b7019f009c019e019d0007000200130008019c007400be00ab019b00aa00bd00b000bc00bb00af001a00ba0006019a00fb019900570198019700570059019600b60195003e00b500b600b900b8002a00b700ec01940193000700020013000800060192000700950027009301910001009201900001009100090090001c0001008f0008018f018e018d009700040007004f004e004d00170004001d00020008018c018b018a009700040007004f004e004d00170004001d000200080189003c0188018701860013018500b5018400580183009700040007004f004e004d00170004001d00020008018201810180017f017e017d017c00c8017b017a00b4017901780177017601750174000901730172017101700041016f016e016d016c00b4016b016a016900fa0168016701660165016401630162009b01610160015f015e015d003a015c015b015a01590158015701560007004f004e004d00170004001d0002000800020013000800060155000700950027009301540001009201530001009100090090001c0001008f000800060152000700950027009301510001009201500001009100090090001c0001008f0008014f014e014d014c00ed014b0009014a0007014900b3000700130007014800b3000700130007014700c100c000000000000000000000000000b20146000000000000000000b200960096014500000000000001440143014200b101410000000000000000000000000140000000000000013f000000000000013e000000000000013d000000000000013c000000000000013b000000000000013a0000000000000139000000000000013801370136013501340133013201310130012f012e012d012c012b012a0129012800000000000001270000000000000126012500000000000001240123012201210120011f011e011d011c011b011a0119011801170116011501140113011201110110010f010e010d010c000000000000010b0000010a0000010901080107010600000000000000960105010400b10000000000000000010300000000000001020000000001010000010000ff0000000000fe00fd00fc00000000000000000000000000000000", - "logIndex": 33, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104 - }, - { - "transactionIndex": 7, - "blockNumber": 520324, - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "address": "0x0000000000000000000000000000000000008004", - "topics": [ - "0xc94722ff13eacf53547c4741dab5228353a05938ffcdd5d4a2d533ae0e618287", - "0x010001a50a3aec77b09895657330834dffcea5d8963453f3248e9830510955ac", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 34, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104 - }, - { - "transactionIndex": 7, - "blockNumber": 520324, - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "address": "0x0000000000000000000000000000000000008006", - "topics": [ - "0x290afdae231a3fc0bbae8b1af63698b0a1d79b21ad17df0342dfb952fe74f8e5", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1", - "0x010001a50a3aec77b09895657330834dffcea5d8963453f3248e9830510955ac", - "0x000000000000000000000000faf0129b9c1fa35c8a9b1e664dd6247ae624c002" - ], - "data": "0x", - "logIndex": 35, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104 - }, - { - "transactionIndex": 7, - "blockNumber": 520324, - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "address": "0x000000000000000000000000000000000000800A", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000008001", - "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" - ], - "data": "0x000000000000000000000000000000000000000000000000000b4376904d3c80", - "logIndex": 36, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104 - } - ], - "blockNumber": 520324, - "confirmations": 401, - "cumulativeGasUsed": { "type": "BigNumber", "hex": "0x00" }, - "effectiveGasPrice": { "type": "BigNumber", "hex": "0x0ee6b280" }, - "status": 1, - "type": 113, - "l1BatchNumber": 5104, - "l1BatchTxIndex": 293, - "l2ToL1Logs": [ - { - "blockNumber": 520324, - "blockHash": "0x2e8243623fbc8e16030fc4f2b4b9ed790038188b850547bf1f40f27419a58351", - "l1BatchNumber": 5104, - "transactionIndex": 7, - "shardId": 0, - "isService": true, - "sender": "0x0000000000000000000000000000000000008008", - "key": "0x000000000000000000000000000000000000000000000000000000000000800e", - "value": "0x9fd7af3b8cde88e76e27fe4a2a0f609dab94072dd3f81d78ec3e5e2e8b3fef20", - "transactionHash": "0x8ddaa348be797f4dd7fda173c635ce771519283f68df42eeace97bf82793b0bd", - "logIndex": 0 - } - ], - "byzantium": true - }, - "args": ["0xAC26e0F627569c04DAe1B1E039B62bb5d6760Fe8"] -} diff --git a/src/supported-chains.js b/src/supported-chains.js index 0d11d5ff..386d36ab 100644 --- a/src/supported-chains.js +++ b/src/supported-chains.js @@ -1,4 +1,3 @@ -// TODO: replace with https://github.com/api3dao/chains/issues/3 module.exports = { chainsSupportedByApi3Market: [ 'arbitrum', @@ -18,7 +17,7 @@ module.exports = { 'polygon-zkevm', 'rsk', ], - chainsSupportedByChainApi: ['ethereum', 'ethereum-goerli-testnet'], + chainsSupportedByChainApi: [], chainsSupportedByDapis: [ 'arbitrum', 'arbitrum-goerli-testnet', @@ -42,10 +41,6 @@ module.exports = { 'linea-goerli-testnet', 'mantle', 'mantle-goerli-testnet', - 'metis', - 'metis-goerli-testnet', - 'milkomeda-c1', - 'milkomeda-c1-testnet', 'moonbeam', 'moonbeam-testnet', 'moonriver', @@ -58,8 +53,5 @@ module.exports = { 'rsk', 'rsk-testnet', 'scroll-goerli-testnet', - 'zksync', - 'zksync-goerli-testnet', ], - chainsSupportedByOevRelay: ['ethereum', 'ethereum-goerli-testnet', 'polygon-testnet'], }; diff --git a/src/token-addresses.js b/src/token-addresses.js deleted file mode 100644 index 19f92dc5..00000000 --- a/src/token-addresses.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - usdc: { ethereum: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' }, -}; diff --git a/test/access-control-registry/AccessControlRegistry.sol.js b/test/access-control-registry/AccessControlRegistry.sol.js index eae00e71..a7a11259 100644 --- a/test/access-control-registry/AccessControlRegistry.sol.js +++ b/test/access-control-registry/AccessControlRegistry.sol.js @@ -26,13 +26,6 @@ describe('AccessControlRegistry', function () { }; } - describe('constructor', function () { - it('constructs', async function () { - const { accessControlRegistry } = await helpers.loadFixture(deploy); - expect(await accessControlRegistry.isTrustedForwarder(accessControlRegistry.address)).to.equal(true); - }); - }); - describe('initializeManager', function () { context('Manager address is not zero', function () { context('Manager is not initialized', function () { @@ -354,40 +347,4 @@ describe('AccessControlRegistry', function () { expect(await accessControlRegistry.hasRole(role12, account12)).to.equal(true); }); }); - - describe('Meta-tx', function () { - it('executes', async function () { - const { roles, accessControlRegistry, managerRootRole, roleDescription, role } = await helpers.loadFixture( - deploy - ); - const expiringMetaTxDomain = await testUtils.expiringMetaTxDomain(accessControlRegistry); - const expiringMetaTxTypes = testUtils.expiringMetaTxTypes(); - const latestTimestamp = await helpers.time.latest(); - const nextTimestamp = latestTimestamp + 1; - await helpers.time.setNextBlockTimestamp(nextTimestamp); - const expiringMetaTxValue = { - from: roles.manager.address, - to: accessControlRegistry.address, - data: accessControlRegistry.interface.encodeFunctionData('initializeRoleAndGrantToSender', [ - managerRootRole, - roleDescription, - ]), - expirationTimestamp: nextTimestamp + 60 * 60, - }; - const signature = await roles.manager._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - expect(await accessControlRegistry.hasRole(managerRootRole, roles.manager.address)).to.equal(false); - expect(await accessControlRegistry.getRoleAdmin(role)).to.equal(ethers.constants.HashZero); - expect(await accessControlRegistry.hasRole(role, roles.manager.address)).to.equal(false); - await expect(accessControlRegistry.connect(roles.randomPerson).execute(expiringMetaTxValue, signature)) - .to.emit(accessControlRegistry, 'InitializedRole') - .withArgs(role, managerRootRole, roleDescription, roles.manager.address); - expect(await accessControlRegistry.hasRole(managerRootRole, roles.manager.address)).to.equal(true); - expect(await accessControlRegistry.getRoleAdmin(role)).to.equal(managerRootRole); - expect(await accessControlRegistry.hasRole(role, roles.manager.address)).to.equal(true); - }); - }); }); diff --git a/test/access-control-registry/AccessControlRegistryAdminned.sol.js b/test/access-control-registry/AccessControlRegistryAdminned.sol.js index 4f323d62..51e84469 100644 --- a/test/access-control-registry/AccessControlRegistryAdminned.sol.js +++ b/test/access-control-registry/AccessControlRegistryAdminned.sol.js @@ -1,7 +1,6 @@ const { ethers } = require('hardhat'); const helpers = require('@nomicfoundation/hardhat-network-helpers'); const { expect } = require('chai'); -const testUtils = require('../test-utils'); describe('AccessControlRegistryAdminned', function () { async function deploy() { @@ -104,30 +103,4 @@ describe('AccessControlRegistryAdminned', function () { ]); }); }); - - describe('Meta-tx', function () { - it('executes', async function () { - const { roles, accessControlRegistry, accessControlRegistryAdminned } = await helpers.loadFixture(deploy); - const expiringMetaTxDomain = await testUtils.expiringMetaTxDomain(accessControlRegistry); - const expiringMetaTxTypes = testUtils.expiringMetaTxTypes(); - const latestTimestamp = await helpers.time.latest(); - const nextTimestamp = latestTimestamp + 1; - await helpers.time.setNextBlockTimestamp(nextTimestamp); - const expiringMetaTxValue = { - from: roles.randomPerson.address, - to: accessControlRegistryAdminned.address, - data: accessControlRegistryAdminned.interface.encodeFunctionData('accessControlRegistry', []), - expirationTimestamp: nextTimestamp + 60 * 60, - }; - const signature = await roles.randomPerson._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - const returndata = await accessControlRegistry - .connect(roles.randomPerson) - .callStatic.execute(expiringMetaTxValue, signature); - expect(returndata).to.equal(ethers.utils.defaultAbiCoder.encode(['address'], [accessControlRegistry.address])); - }); - }); }); diff --git a/test/allocators/AllocatorWithAirnode.sol.js b/test/allocators/AllocatorWithAirnode.sol.js index 71e92aee..6b1c3d9b 100644 --- a/test/allocators/AllocatorWithAirnode.sol.js +++ b/test/allocators/AllocatorWithAirnode.sol.js @@ -55,11 +55,8 @@ describe('AllocatorWithAirnode', function () { describe('constructor', function () { it('constructs', async function () { - const { accessControlRegistry, allocatorWithAirnode, slotSetterRoleDescription } = await helpers.loadFixture( - deploy - ); + const { allocatorWithAirnode, slotSetterRoleDescription } = await helpers.loadFixture(deploy); expect(await allocatorWithAirnode.SLOT_SETTER_ROLE_DESCRIPTION()).to.equal(slotSetterRoleDescription); - expect(await allocatorWithAirnode.isTrustedForwarder(accessControlRegistry.address)).to.equal(true); }); }); diff --git a/test/allocators/AllocatorWithManager.sol.js b/test/allocators/AllocatorWithManager.sol.js index 6f223f8e..dd6b3b4f 100644 --- a/test/allocators/AllocatorWithManager.sol.js +++ b/test/allocators/AllocatorWithManager.sol.js @@ -55,11 +55,9 @@ describe('AllocatorWithManager', function () { describe('constructor', function () { it('constructs', async function () { - const { accessControlRegistry, allocatorWithManager, slotSetterRoleDescription, slotSetterRole } = - await helpers.loadFixture(deploy); + const { allocatorWithManager, slotSetterRoleDescription, slotSetterRole } = await helpers.loadFixture(deploy); expect(await allocatorWithManager.SLOT_SETTER_ROLE_DESCRIPTION()).to.equal(slotSetterRoleDescription); expect(await allocatorWithManager.slotSetterRole()).to.equal(slotSetterRole); - expect(await allocatorWithManager.isTrustedForwarder(accessControlRegistry.address)).to.equal(true); }); }); diff --git a/test/authorizers/RequesterAuthorizerWithAirnode.sol.js b/test/authorizers/RequesterAuthorizerWithAirnode.sol.js index dc9fc488..b797b43e 100644 --- a/test/authorizers/RequesterAuthorizerWithAirnode.sol.js +++ b/test/authorizers/RequesterAuthorizerWithAirnode.sol.js @@ -218,114 +218,6 @@ describe('RequesterAuthorizerWithAirnode', function () { }); }); }); - // Let us demonstrate meta-txes as a proof of concept - context('Sender using a meta-tx signed by the Airnode address', function () { - context('Timestamp extends authorization expiration', function () { - it('extends authorization expiration', async function () { - const { roles, accessControlRegistry, requesterAuthorizerWithAirnode } = await helpers.loadFixture(deploy); - const authorizationStatusBefore = - await requesterAuthorizerWithAirnode.airnodeToRequesterToAuthorizationStatus( - roles.airnode.address, - roles.requester.address - ); - expect(authorizationStatusBefore.expirationTimestamp).to.equal(0); - expect(authorizationStatusBefore.indefiniteAuthorizationCount).to.equal(0); - const expirationTimestamp = 1000; - - const from = roles.airnode.address; - const to = requesterAuthorizerWithAirnode.address; - const data = requesterAuthorizerWithAirnode.interface.encodeFunctionData('extendAuthorizerExpiration', [ - roles.airnode.address, - roles.requester.address, - expirationTimestamp, - ]); - const metaTxExpirationTimestamp = (await testUtils.getCurrentTimestamp(ethers.provider)) + 3600; - - const domainName = 'ExpiringMetaTxForwarder'; - const domainVersion = '1.0.0'; - const domainChainId = (await ethers.provider.getNetwork()).chainId; - const domainAddress = accessControlRegistry.address; - - const domain = { - name: domainName, - version: domainVersion, - chainId: domainChainId, - verifyingContract: domainAddress, - }; - const types = { - ExpiringMetaTx: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'data', type: 'bytes' }, - { name: 'expirationTimestamp', type: 'uint256' }, - ], - }; - const value = { - from, - to, - data, - expirationTimestamp: metaTxExpirationTimestamp, - }; - const signature = await roles.airnode._signTypedData(domain, types, value); - - await expect(accessControlRegistry.connect(roles.randomPerson).execute(value, signature)) - .to.emit(requesterAuthorizerWithAirnode, 'ExtendedAuthorizationExpiration') - .withArgs(roles.airnode.address, roles.requester.address, expirationTimestamp, roles.airnode.address); - - const authorizationStatusAfter = await requesterAuthorizerWithAirnode.airnodeToRequesterToAuthorizationStatus( - roles.airnode.address, - roles.requester.address - ); - expect(authorizationStatusAfter.expirationTimestamp).to.equal(1000); - expect(authorizationStatusAfter.indefiniteAuthorizationCount).to.equal(0); - }); - }); - context('Timestamp does not extend authorization expiration', function () { - it('reverts', async function () { - const { roles, accessControlRegistry, requesterAuthorizerWithAirnode } = await helpers.loadFixture(deploy); - - const from = roles.airnode.address; - const to = requesterAuthorizerWithAirnode.address; - const data = requesterAuthorizerWithAirnode.interface.encodeFunctionData('extendAuthorizerExpiration', [ - roles.airnode.address, - roles.requester.address, - 0, - ]); - const metaTxExpirationTimestamp = (await testUtils.getCurrentTimestamp(ethers.provider)) + 3600; - - const domainName = 'ExpiringMetaTxForwarder'; - const domainVersion = '1.0.0'; - const domainChainId = (await ethers.provider.getNetwork()).chainId; - const domainAddress = accessControlRegistry.address; - - const domain = { - name: domainName, - version: domainVersion, - chainId: domainChainId, - verifyingContract: domainAddress, - }; - const types = { - ExpiringMetaTx: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'data', type: 'bytes' }, - { name: 'expirationTimestamp', type: 'uint256' }, - ], - }; - const value = { - from, - to, - data, - expirationTimestamp: metaTxExpirationTimestamp, - }; - const signature = await roles.airnode._signTypedData(domain, types, value); - - await expect(accessControlRegistry.connect(roles.randomPerson).execute(value, signature)).to.be.revertedWith( - 'Does not extend expiration' - ); - }); - }); - }); context( 'Sender does not have the authorization expiration extender role and is not the Airnode address', function () { diff --git a/test/authorizers/RequesterAuthorizerWithManager.sol.js b/test/authorizers/RequesterAuthorizerWithManager.sol.js index 693bbca1..34a998f1 100644 --- a/test/authorizers/RequesterAuthorizerWithManager.sol.js +++ b/test/authorizers/RequesterAuthorizerWithManager.sol.js @@ -245,114 +245,6 @@ describe('RequesterAuthorizerWithManager', function () { }); }); }); - // Let us demonstrate meta-txes as a proof of concept - context('Sender using a meta-tx signed by the manager', function () { - context('Timestamp extends authorization expiration', function () { - it('extends authorization expiration', async function () { - const { roles, accessControlRegistry, requesterAuthorizerWithManager } = await helpers.loadFixture(deploy); - const authorizationStatusBefore = - await requesterAuthorizerWithManager.airnodeToRequesterToAuthorizationStatus( - roles.airnode.address, - roles.requester.address - ); - expect(authorizationStatusBefore.expirationTimestamp).to.equal(0); - expect(authorizationStatusBefore.indefiniteAuthorizationCount).to.equal(0); - const expirationTimestamp = 1000; - - const from = roles.manager.address; - const to = requesterAuthorizerWithManager.address; - const data = requesterAuthorizerWithManager.interface.encodeFunctionData('extendAuthorizerExpiration', [ - roles.airnode.address, - roles.requester.address, - expirationTimestamp, - ]); - const metaTxExpirationTimestamp = (await testUtils.getCurrentTimestamp(ethers.provider)) + 3600; - - const domainName = 'ExpiringMetaTxForwarder'; - const domainVersion = '1.0.0'; - const domainChainId = (await ethers.provider.getNetwork()).chainId; - const domainAddress = accessControlRegistry.address; - - const domain = { - name: domainName, - version: domainVersion, - chainId: domainChainId, - verifyingContract: domainAddress, - }; - const types = { - ExpiringMetaTx: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'data', type: 'bytes' }, - { name: 'expirationTimestamp', type: 'uint256' }, - ], - }; - const value = { - from, - to, - data, - expirationTimestamp: metaTxExpirationTimestamp, - }; - const signature = await roles.manager._signTypedData(domain, types, value); - - await expect(accessControlRegistry.connect(roles.randomPerson).execute(value, signature)) - .to.emit(requesterAuthorizerWithManager, 'ExtendedAuthorizationExpiration') - .withArgs(roles.airnode.address, roles.requester.address, expirationTimestamp, roles.manager.address); - - const authorizationStatusAfter = await requesterAuthorizerWithManager.airnodeToRequesterToAuthorizationStatus( - roles.airnode.address, - roles.requester.address - ); - expect(authorizationStatusAfter.expirationTimestamp).to.equal(1000); - expect(authorizationStatusAfter.indefiniteAuthorizationCount).to.equal(0); - }); - }); - context('Timestamp does not extend authorization expiration', function () { - it('reverts', async function () { - const { roles, accessControlRegistry, requesterAuthorizerWithManager } = await helpers.loadFixture(deploy); - - const from = roles.manager.address; - const to = requesterAuthorizerWithManager.address; - const data = requesterAuthorizerWithManager.interface.encodeFunctionData('extendAuthorizerExpiration', [ - roles.airnode.address, - roles.requester.address, - 0, - ]); - const metaTxExpirationTimestamp = (await testUtils.getCurrentTimestamp(ethers.provider)) + 3600; - - const domainName = 'ExpiringMetaTxForwarder'; - const domainVersion = '1.0.0'; - const domainChainId = (await ethers.provider.getNetwork()).chainId; - const domainAddress = accessControlRegistry.address; - - const domain = { - name: domainName, - version: domainVersion, - chainId: domainChainId, - verifyingContract: domainAddress, - }; - const types = { - ExpiringMetaTx: [ - { name: 'from', type: 'address' }, - { name: 'to', type: 'address' }, - { name: 'data', type: 'bytes' }, - { name: 'expirationTimestamp', type: 'uint256' }, - ], - }; - const value = { - from, - to, - data, - expirationTimestamp: metaTxExpirationTimestamp, - }; - const signature = await roles.manager._signTypedData(domain, types, value); - - await expect(accessControlRegistry.connect(roles.randomPerson).execute(value, signature)).to.be.revertedWith( - 'Does not extend expiration' - ); - }); - }); - }); context('Sender does not have the authorization expiration extender role and is not the manager', function () { it('reverts', async function () { const { roles, requesterAuthorizerWithManager } = await helpers.loadFixture(deploy); diff --git a/test/utils/ExpiringMetaTxForwarder.sol.js b/test/utils/ExpiringMetaTxForwarder.sol.js deleted file mode 100644 index 06c0d35e..00000000 --- a/test/utils/ExpiringMetaTxForwarder.sol.js +++ /dev/null @@ -1,247 +0,0 @@ -const { ethers } = require('hardhat'); -const helpers = require('@nomicfoundation/hardhat-network-helpers'); -const { expect } = require('chai'); -const testUtils = require('../test-utils'); - -describe('ExpiringMetaTxForwarder', function () { - function deriveTypedDataHashOfMetaTx(domain, value) { - const domainTypeHash = ethers.utils.keccak256( - ethers.utils.toUtf8Bytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)') - ); - const nameHash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(domain.name)); - const versionHash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(domain.version)); - const domainSeparator = ethers.utils.keccak256( - ethers.utils.defaultAbiCoder.encode( - ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], - [domainTypeHash, nameHash, versionHash, domain.chainId, domain.verifyingContract] - ) - ); - - // Struct hash derivation - const structTypeHash = ethers.utils.keccak256( - ethers.utils.toUtf8Bytes('ExpiringMetaTx(address from,address to,bytes data,uint256 expirationTimestamp)') - ); - const structHash = ethers.utils.keccak256( - ethers.utils.defaultAbiCoder.encode( - ['bytes32', 'address', 'address', 'bytes32', 'uint256'], - [structTypeHash, value.from, value.to, ethers.utils.keccak256(value.data), value.expirationTimestamp] - ) - ); - - // Typed data hash derivation - const typedDataHash = ethers.utils.keccak256( - ethers.utils.solidityPack(['string', 'bytes32', 'bytes32'], ['\x19\x01', domainSeparator, structHash]) - ); - return typedDataHash; - } - - async function deploy() { - const accounts = await ethers.getSigners(); - const roles = { - deployer: accounts[0], - owner: accounts[1], - randomPerson: accounts[9], - }; - const expiringMetaTxForwarderFactory = await ethers.getContractFactory('ExpiringMetaTxForwarder', roles.deployer); - const expiringMetaTxForwarder = await expiringMetaTxForwarderFactory.deploy(); - const expiringMetaTxForwarderTargetFactory = await ethers.getContractFactory( - 'MockExpiringMetaTxForwarderTarget', - roles.deployer - ); - const expiringMetaTxForwarderTarget = await expiringMetaTxForwarderTargetFactory.deploy( - expiringMetaTxForwarder.address, - roles.owner.address - ); - const latestTimestamp = await helpers.time.latest(); - const nextTimestamp = latestTimestamp + 1; - await helpers.time.setNextBlockTimestamp(nextTimestamp); - const expiringMetaTxValue = { - from: roles.owner.address, - to: expiringMetaTxForwarderTarget.address, - data: expiringMetaTxForwarderTarget.interface.encodeFunctionData('incrementCounter', []), - expirationTimestamp: nextTimestamp + 60 * 60, - }; - return { - roles, - expiringMetaTxForwarder, - expiringMetaTxForwarderTarget, - expiringMetaTxDomain: await testUtils.expiringMetaTxDomain(expiringMetaTxForwarder), - expiringMetaTxTypes: testUtils.expiringMetaTxTypes(), - expiringMetaTxValue, - }; - } - - describe('execute', function () { - context('Meta-tx with hash is not executed', function () { - context('Meta-tx with hash is not canceled', function () { - context('Meta-tx has not expired', function () { - context('Signature is valid', function () { - it('executes', async function () { - const { - roles, - expiringMetaTxForwarder, - expiringMetaTxForwarderTarget, - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue, - } = await helpers.loadFixture(deploy); - const signature = await roles.owner._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - const counterInitial = await expiringMetaTxForwarderTarget.counter(); - const metaTxTypedDataHash = deriveTypedDataHashOfMetaTx(expiringMetaTxDomain, expiringMetaTxValue); - expect(await expiringMetaTxForwarder.metaTxWithHashIsExecutedOrCanceled(metaTxTypedDataHash)).to.equal( - false - ); - const returndata = await expiringMetaTxForwarder - .connect(roles.randomPerson) - .callStatic.execute(expiringMetaTxValue, signature); - expect(returndata).to.equal(counterInitial.add(1)); - await expect(expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature)) - .to.emit(expiringMetaTxForwarder, 'ExecutedMetaTx') - .withArgs(metaTxTypedDataHash); - expect(await expiringMetaTxForwarderTarget.counter()).to.be.equal(counterInitial.add(1)); - expect(await expiringMetaTxForwarder.metaTxWithHashIsExecutedOrCanceled(metaTxTypedDataHash)).to.equal( - true - ); - }); - }); - context('Signature is not valid', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxDomain, expiringMetaTxTypes, expiringMetaTxValue } = - await helpers.loadFixture(deploy); - const signature = await roles.randomPerson._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - await expect( - expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature) - ).to.be.revertedWith('Invalid signature'); - }); - }); - }); - context('Meta-tx has expired', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxDomain, expiringMetaTxTypes, expiringMetaTxValue } = - await helpers.loadFixture(deploy); - const signature = await roles.owner._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - await helpers.time.setNextBlockTimestamp(expiringMetaTxValue.expirationTimestamp); - await expect( - expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature) - ).to.be.revertedWith('Meta-tx expired'); - }); - }); - }); - context('Meta-tx with hash is canceled', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxDomain, expiringMetaTxTypes, expiringMetaTxValue } = - await helpers.loadFixture(deploy); - const signature = await roles.owner._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - await expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue); - await expect( - expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature) - ).to.be.revertedWith('Meta-tx executed or canceled'); - }); - }); - }); - context('Meta-tx with hash is already executed', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxDomain, expiringMetaTxTypes, expiringMetaTxValue } = - await helpers.loadFixture(deploy); - const signature = await roles.owner._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - await expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature); - await expect( - expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature) - ).to.be.revertedWith('Meta-tx executed or canceled'); - }); - }); - }); - - describe('cancel', function () { - context('Sender is meta-tx source', function () { - context('Meta-tx with hash is not executed yet', function () { - context('Meta-tx with hash is not canceled yet', function () { - context('Meta-tx has not expired', function () { - it('nullifies', async function () { - const { - roles, - expiringMetaTxForwarder, - expiringMetaTxForwarderTarget, - expiringMetaTxDomain, - expiringMetaTxValue, - } = await helpers.loadFixture(deploy); - const counterInitial = await expiringMetaTxForwarderTarget.counter(); - const metaTxTypedDataHash = deriveTypedDataHashOfMetaTx(expiringMetaTxDomain, expiringMetaTxValue); - expect(await expiringMetaTxForwarder.metaTxWithHashIsExecutedOrCanceled(metaTxTypedDataHash)).to.equal( - false - ); - await expect(expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue)) - .to.emit(expiringMetaTxForwarder, 'CanceledMetaTx') - .withArgs(metaTxTypedDataHash); - expect(await expiringMetaTxForwarderTarget.counter()).to.be.equal(counterInitial); - expect(await expiringMetaTxForwarder.metaTxWithHashIsExecutedOrCanceled(metaTxTypedDataHash)).to.equal( - true - ); - }); - }); - context('Meta-tx has expired', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxValue } = await helpers.loadFixture(deploy); - await helpers.time.setNextBlockTimestamp(expiringMetaTxValue.expirationTimestamp); - await expect(expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue)).to.be.revertedWith( - 'Meta-tx expired' - ); - }); - }); - }); - context('Meta-tx with hash is already canceled', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxValue } = await helpers.loadFixture(deploy); - await expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue); - await expect(expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue)).to.be.revertedWith( - 'Meta-tx executed or canceled' - ); - }); - }); - }); - context('Meta-tx with hash is already executed', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxDomain, expiringMetaTxTypes, expiringMetaTxValue } = - await helpers.loadFixture(deploy); - const signature = await roles.owner._signTypedData( - expiringMetaTxDomain, - expiringMetaTxTypes, - expiringMetaTxValue - ); - await expiringMetaTxForwarder.connect(roles.randomPerson).execute(expiringMetaTxValue, signature); - await expect(expiringMetaTxForwarder.connect(roles.owner).cancel(expiringMetaTxValue)).to.be.revertedWith( - 'Meta-tx executed or canceled' - ); - }); - }); - }); - context('Sender is not meta-tx source', function () { - it('reverts', async function () { - const { roles, expiringMetaTxForwarder, expiringMetaTxValue } = await helpers.loadFixture(deploy); - await expect( - expiringMetaTxForwarder.connect(roles.randomPerson).cancel(expiringMetaTxValue) - ).to.be.revertedWith('Sender not meta-tx source'); - }); - }); - }); -}); diff --git a/test/utils/PrepaymentDepository.sol.js b/test/utils/PrepaymentDepository.sol.js deleted file mode 100644 index 4acb8131..00000000 --- a/test/utils/PrepaymentDepository.sol.js +++ /dev/null @@ -1,1142 +0,0 @@ -const { ethers } = require('hardhat'); -const helpers = require('@nomicfoundation/hardhat-network-helpers'); -const { expect } = require('chai'); -const testUtils = require('../test-utils'); - -describe('PrepaymentDepository', function () { - async function deposit(token, prepaymentDepository, account, amount) { - await token.connect(account).approve(prepaymentDepository.address, amount); - await prepaymentDepository.connect(account).deposit(account.address, amount); - } - - async function signErc2612Permit(token, signer, spenderAddress, amount, deadline) { - return ethers.utils.splitSignature( - await signer._signTypedData( - { - name: await token.name(), - version: '2', - chainId: (await token.provider.getNetwork()).chainId, - verifyingContract: token.address, - }, - { - Permit: [ - { - name: 'owner', - type: 'address', - }, - { - name: 'spender', - type: 'address', - }, - { - name: 'value', - type: 'uint256', - }, - { - name: 'nonce', - type: 'uint256', - }, - { - name: 'deadline', - type: 'uint256', - }, - ], - }, - { - owner: signer.address, - spender: spenderAddress, - value: amount, - nonce: await token.nonces(signer.address), - deadline, - } - ) - ); - } - - async function signWithdrawal(prepaymentDepository, signer, userAddress, amount, expirationTimestamp) { - const withdrawalHash = ethers.utils.solidityKeccak256( - ['uint256', 'address', 'address', 'uint256', 'uint256'], - [ - (await prepaymentDepository.provider.getNetwork()).chainId, - prepaymentDepository.address, - userAddress, - amount, - expirationTimestamp, - ] - ); - const signature = signer.signMessage(ethers.utils.arrayify(withdrawalHash)); - return { withdrawalHash, signature }; - } - - async function deploy() { - const accounts = await ethers.getSigners(); - const roles = { - deployer: accounts[0], - manager: accounts[1], - withdrawalSigner: accounts[2], - userWithdrawalLimitIncreaser: accounts[3], - userWithdrawalLimitDecreaser: accounts[4], - claimer: accounts[5], - user: accounts[6], - withdrawalDestination: accounts[7], - recipient: accounts[8], - randomPerson: accounts[9], - }; - const adminRoleDescription = 'PrepaymentDepository admin'; - const withdrawalSignerRoleDescription = 'Withdrawal signer'; - const userWithdrawalLimitIncreaserRoleDescription = 'User withdrawal limit increaser'; - const userWithdrawalLimitDecreaserRoleDescription = 'User withdrawal limit decreaser'; - const claimerRoleDescription = 'Claimer'; - - const accessControlRegistryFactory = await ethers.getContractFactory('AccessControlRegistry', roles.deployer); - const accessControlRegistry = await accessControlRegistryFactory.deploy(); - const tokenFactory = await ethers.getContractFactory('MockErc20PermitToken', roles.deployer); - const token = await tokenFactory.deploy(roles.deployer.address); - const prepaymentRepositoryFactory = await ethers.getContractFactory('PrepaymentDepository', roles.deployer); - const prepaymentDepository = await prepaymentRepositoryFactory.deploy( - accessControlRegistry.address, - adminRoleDescription, - roles.manager.address, - token.address - ); - - const userBalance = 1000000; - const initialDepositAmount = 1000; - await token.connect(roles.deployer).transfer(roles.user.address, userBalance); - await token.connect(roles.deployer).transfer(roles.randomPerson.address, userBalance); - await deposit(token, prepaymentDepository, roles.user, initialDepositAmount); - - const rootRole = testUtils.deriveRootRole(roles.manager.address); - const adminRole = testUtils.deriveRole(rootRole, adminRoleDescription); - const withdrawalSignerRole = testUtils.deriveRole(adminRole, withdrawalSignerRoleDescription); - const userWithdrawalLimitIncreaserRole = testUtils.deriveRole( - adminRole, - userWithdrawalLimitIncreaserRoleDescription - ); - const userWithdrawalLimitDecreaserRole = testUtils.deriveRole( - adminRole, - userWithdrawalLimitDecreaserRoleDescription - ); - const claimerRole = testUtils.deriveRole(adminRole, claimerRoleDescription); - await accessControlRegistry.connect(roles.manager).initializeRoleAndGrantToSender(rootRole, adminRoleDescription); - await accessControlRegistry - .connect(roles.manager) - .initializeRoleAndGrantToSender(adminRole, withdrawalSignerRoleDescription); - await accessControlRegistry - .connect(roles.manager) - .initializeRoleAndGrantToSender(adminRole, userWithdrawalLimitIncreaserRoleDescription); - await accessControlRegistry - .connect(roles.manager) - .initializeRoleAndGrantToSender(adminRole, userWithdrawalLimitDecreaserRoleDescription); - await accessControlRegistry - .connect(roles.manager) - .initializeRoleAndGrantToSender(adminRole, claimerRoleDescription); - await accessControlRegistry.connect(roles.manager).grantRole(withdrawalSignerRole, roles.withdrawalSigner.address); - await accessControlRegistry - .connect(roles.manager) - .grantRole(userWithdrawalLimitIncreaserRole, roles.userWithdrawalLimitIncreaser.address); - await accessControlRegistry - .connect(roles.manager) - .grantRole(userWithdrawalLimitDecreaserRole, roles.userWithdrawalLimitDecreaser.address); - await accessControlRegistry.connect(roles.manager).grantRole(claimerRole, roles.claimer.address); - await accessControlRegistry.connect(roles.manager).renounceRole(adminRole, roles.manager.address); - await accessControlRegistry.connect(roles.manager).renounceRole(withdrawalSignerRole, roles.manager.address); - await accessControlRegistry - .connect(roles.manager) - .renounceRole(userWithdrawalLimitIncreaserRole, roles.manager.address); - await accessControlRegistry - .connect(roles.manager) - .renounceRole(userWithdrawalLimitDecreaserRole, roles.manager.address); - await accessControlRegistry.connect(roles.manager).renounceRole(claimerRole, roles.manager.address); - return { - roles, - accessControlRegistry, - token, - prepaymentDepository, - adminRoleDescription, - withdrawalSignerRole, - userWithdrawalLimitIncreaserRole, - userWithdrawalLimitDecreaserRole, - claimerRole, - }; - } - - describe('constructor', function () { - context('Token contract address is not zero', function () { - it('constructs', async function () { - const { - token, - prepaymentDepository, - withdrawalSignerRole, - userWithdrawalLimitIncreaserRole, - userWithdrawalLimitDecreaserRole, - claimerRole, - } = await helpers.loadFixture(deploy); - expect(await prepaymentDepository.token()).to.equal(token.address); - expect(await prepaymentDepository.withdrawalSignerRole()).to.equal(withdrawalSignerRole); - expect(await prepaymentDepository.userWithdrawalLimitIncreaserRole()).to.equal( - userWithdrawalLimitIncreaserRole - ); - expect(await prepaymentDepository.userWithdrawalLimitDecreaserRole()).to.equal( - userWithdrawalLimitDecreaserRole - ); - expect(await prepaymentDepository.claimerRole()).to.equal(claimerRole); - }); - }); - context('Token contract address is zero', function () { - it('reverts', async function () { - const { roles, accessControlRegistry, adminRoleDescription } = await helpers.loadFixture(deploy); - const prepaymentRepositoryFactory = await ethers.getContractFactory('PrepaymentDepository', roles.deployer); - await expect( - prepaymentRepositoryFactory.deploy( - accessControlRegistry.address, - adminRoleDescription, - roles.manager.address, - ethers.constants.AddressZero - ) - ).to.be.revertedWith('Token address zero'); - }); - }); - }); - - describe('setWithdrawalDestination', function () { - context('User and withdrawal destination are not the same', function () { - context('Sender is the user', function () { - context('User withdrawal destination address is zero', function () { - it('sets withdrawal destination', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - expect(await prepaymentDepository.userToWithdrawalDestination(roles.user.address)).to.equal( - ethers.constants.AddressZero - ); - await expect( - prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address) - ) - .to.emit(prepaymentDepository, 'SetWithdrawalDestination') - .withArgs(roles.user.address, roles.withdrawalDestination.address); - expect(await prepaymentDepository.userToWithdrawalDestination(roles.user.address)).to.equal( - roles.withdrawalDestination.address - ); - }); - }); - context('User withdrawal destination address is not zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - await expect( - prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.randomPerson.address) - ).to.be.revertedWith('Sender not destination'); - }); - }); - }); - context('Sender is not the user', function () { - context('Sender is the user withdrawal destination', function () { - it('sets withdrawal destination', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - expect(await prepaymentDepository.userToWithdrawalDestination(roles.user.address)).to.equal( - roles.withdrawalDestination.address - ); - await expect( - prepaymentDepository - .connect(roles.withdrawalDestination) - .setWithdrawalDestination(roles.user.address, ethers.constants.AddressZero) - ) - .to.emit(prepaymentDepository, 'SetWithdrawalDestination') - .withArgs(roles.user.address, ethers.constants.AddressZero); - expect(await prepaymentDepository.userToWithdrawalDestination(roles.user.address)).to.equal( - ethers.constants.AddressZero - ); - }); - }); - context('Sender is not the user withdrawal destination', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - await expect( - prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.randomPerson.address) - ).to.be.revertedWith('Sender not destination'); - }); - }); - }); - }); - context('User and withdrawal destination are the same', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await expect( - prepaymentDepository.setWithdrawalDestination(roles.user.address, roles.user.address) - ).to.be.revertedWith('Same user and destination'); - }); - }); - }); - - describe('increaseUserWithdrawalLimit', function () { - context('User address is not zero', function () { - context('Amount is not zero', function () { - context('Sender is the manager', function () { - it('increases user withdrawal limit', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const increaseAmount = initialLimit; - const expectedLimit = initialLimit.add(increaseAmount); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(initialLimit); - expect( - await prepaymentDepository - .connect(roles.manager) - .callStatic.increaseUserWithdrawalLimit(roles.user.address, increaseAmount) - ).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.manager) - .increaseUserWithdrawalLimit(roles.user.address, increaseAmount) - ) - .to.emit(prepaymentDepository, 'IncreasedUserWithdrawalLimit') - .withArgs(roles.user.address, increaseAmount, expectedLimit, roles.manager.address); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(expectedLimit); - }); - }); - context('Sender is a user withdrawal limit increaser', function () { - it('increases user withdrawal limit', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const increaseAmount = initialLimit; - const expectedLimit = initialLimit.add(increaseAmount); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(initialLimit); - expect( - await prepaymentDepository - .connect(roles.userWithdrawalLimitIncreaser) - .callStatic.increaseUserWithdrawalLimit(roles.user.address, increaseAmount) - ).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.userWithdrawalLimitIncreaser) - .increaseUserWithdrawalLimit(roles.user.address, increaseAmount) - ) - .to.emit(prepaymentDepository, 'IncreasedUserWithdrawalLimit') - .withArgs(roles.user.address, increaseAmount, expectedLimit, roles.userWithdrawalLimitIncreaser.address); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(expectedLimit); - }); - }); - context('Sender is not the manager or a user withdrawal limit increaser', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const increaseAmount = initialLimit; - await expect( - prepaymentDepository - .connect(roles.randomPerson) - .increaseUserWithdrawalLimit(roles.user.address, increaseAmount) - ).to.be.revertedWith('Cannot increase withdrawal limit'); - }); - }); - }); - context('Amount is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await expect( - prepaymentDepository.connect(roles.manager).increaseUserWithdrawalLimit(roles.user.address, 0) - ).to.be.revertedWith('Amount zero'); - }); - }); - }); - context('User address is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const increaseAmount = initialLimit; - await expect( - prepaymentDepository - .connect(roles.manager) - .increaseUserWithdrawalLimit(ethers.constants.AddressZero, increaseAmount) - ).to.be.revertedWith('User address zero'); - }); - }); - }); - - describe('decreaseUserWithdrawalLimit', function () { - context('User address is not zero', function () { - context('Amount is not zero', function () { - context('Sender is the manager', function () { - context('Amount does not exceed withdrawal limit', function () { - it('decreases user withdrawal limit', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const decreaseAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(decreaseAmount); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(initialLimit); - expect( - await prepaymentDepository - .connect(roles.manager) - .callStatic.decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.manager) - .decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ) - .to.emit(prepaymentDepository, 'DecreasedUserWithdrawalLimit') - .withArgs(roles.user.address, decreaseAmount, expectedLimit, roles.manager.address); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(expectedLimit); - }); - }); - context('Amount exceeds withdrawal limit', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const decreaseAmount = initialLimit.mul(2); - await expect( - prepaymentDepository - .connect(roles.manager) - .decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ).to.be.revertedWith('Amount exceeds limit'); - }); - }); - }); - context('Sender is a user withdrawal limit decreaser', function () { - context('Amount does not exceed withdrawal limit', function () { - it('decreases user withdrawal limit', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const decreaseAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(decreaseAmount); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(initialLimit); - expect( - await prepaymentDepository - .connect(roles.userWithdrawalLimitDecreaser) - .callStatic.decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.userWithdrawalLimitDecreaser) - .decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ) - .to.emit(prepaymentDepository, 'DecreasedUserWithdrawalLimit') - .withArgs( - roles.user.address, - decreaseAmount, - expectedLimit, - roles.userWithdrawalLimitDecreaser.address - ); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.equal(expectedLimit); - }); - }); - context('Amount exceeds withdrawal limit', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const decreaseAmount = initialLimit.mul(2); - await expect( - prepaymentDepository - .connect(roles.userWithdrawalLimitDecreaser) - .decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ).to.be.revertedWith('Amount exceeds limit'); - }); - }); - }); - context('Sender is not the manager or a user withdrawal limit decreaser', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const decreaseAmount = initialLimit.div(2); - await expect( - prepaymentDepository - .connect(roles.randomPerson) - .decreaseUserWithdrawalLimit(roles.user.address, decreaseAmount) - ).to.be.revertedWith('Cannot decrease withdrawal limit'); - }); - }); - }); - context('Amount is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await expect( - prepaymentDepository.connect(roles.manager).decreaseUserWithdrawalLimit(roles.user.address, 0) - ).to.be.revertedWith('Amount zero'); - }); - }); - }); - context('User address is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const decreaseAmount = 500; - await expect( - prepaymentDepository - .connect(roles.manager) - .decreaseUserWithdrawalLimit(ethers.constants.AddressZero, decreaseAmount) - ).to.be.revertedWith('User address zero'); - }); - }); - }); - - describe('claim', function () { - context('Recipient address is not zero', function () { - context('Amount is not zero', function () { - context('Sender is the manager', function () { - context('Transfer is successful', function () { - it('claims', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.div(2); - expect(await token.balanceOf(roles.recipient.address)).to.equal(0); - await expect(prepaymentDepository.connect(roles.manager).claim(roles.recipient.address, amount)) - .to.emit(prepaymentDepository, 'Claimed') - .withArgs(roles.recipient.address, amount, roles.manager.address); - expect(await token.balanceOf(roles.recipient.address)).to.equal(amount); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.mul(2); - await expect( - prepaymentDepository.connect(roles.manager).claim(roles.recipient.address, amount) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - context('Sender is a claimer', function () { - context('Transfer is successful', function () { - it('claims', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.div(2); - expect(await token.balanceOf(roles.recipient.address)).to.equal(0); - await expect(prepaymentDepository.connect(roles.claimer).claim(roles.recipient.address, amount)) - .to.emit(prepaymentDepository, 'Claimed') - .withArgs(roles.recipient.address, amount, roles.claimer.address); - expect(await token.balanceOf(roles.recipient.address)).to.equal(amount); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.mul(2); - await expect( - prepaymentDepository.connect(roles.claimer).claim(roles.recipient.address, amount) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - context('Sender is not the manager or a claimer', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.div(2); - await expect( - prepaymentDepository.connect(roles.randomPerson).claim(roles.recipient.address, amount) - ).to.be.revertedWith('Cannot claim'); - }); - }); - }); - context('Amount is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await expect( - prepaymentDepository.connect(roles.manager).claim(roles.recipient.address, 0) - ).to.be.revertedWith('Amount zero'); - }); - }); - }); - context('Recipient address is zero', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const maximumClaimAmount = await token.balanceOf(prepaymentDepository.address); - const amount = maximumClaimAmount.div(2); - await expect( - prepaymentDepository.connect(roles.manager).claim(ethers.constants.AddressZero, amount) - ).to.be.revertedWith('Recipient address zero'); - }); - }); - }); - - describe('deposit', function () { - context('User address is not zero', function () { - context('Amount is not zero', function () { - context('Transfer is successful', function () { - it('deposits', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const depositAmount = initialLimit; - const expectedLimit = initialLimit.add(depositAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.add(depositAmount); - await token.connect(roles.randomPerson).approve(prepaymentDepository.address, depositAmount); - expect( - await prepaymentDepository - .connect(roles.randomPerson) - .callStatic.deposit(roles.user.address, depositAmount) - ).to.equal(expectedLimit); - await expect(prepaymentDepository.connect(roles.randomPerson).deposit(roles.user.address, depositAmount)) - .to.emit(prepaymentDepository, 'Deposited') - .withArgs(roles.user.address, depositAmount, expectedLimit, roles.randomPerson.address); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal(expectedLimit); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const depositAmount = initialLimit; - await expect( - prepaymentDepository.connect(roles.randomPerson).deposit(roles.user.address, depositAmount) - ).to.be.revertedWith('ERC20: insufficient allowance'); - }); - }); - }); - context('Amount is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - await expect( - prepaymentDepository.connect(roles.randomPerson).deposit(roles.user.address, 0) - ).to.be.revertedWith('Amount zero'); - }); - }); - }); - context('User address is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const depositAmount = initialLimit; - await expect( - prepaymentDepository.connect(roles.randomPerson).deposit(ethers.constants.AddressZero, depositAmount) - ).to.be.revertedWith('User address zero'); - }); - }); - }); - - describe('applyPermitAndDeposit', function () { - context('Permit is valid', function () { - it('applies permit and deposits', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const depositAmount = initialLimit; - const expectedLimit = initialLimit.add(depositAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.add(depositAmount); - const deadline = ethers.constants.MaxUint256; - const { v, r, s } = await signErc2612Permit( - token, - roles.randomPerson, - prepaymentDepository.address, - depositAmount, - deadline - ); - expect( - await prepaymentDepository - .connect(roles.randomPerson) - .callStatic.applyPermitAndDeposit(roles.user.address, depositAmount, deadline, v, r, s) - ).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.randomPerson) - .applyPermitAndDeposit(roles.user.address, depositAmount, deadline, v, r, s) - ) - .to.emit(prepaymentDepository, 'Deposited') - .withArgs(roles.user.address, depositAmount, expectedLimit, roles.randomPerson.address); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal(expectedLimit); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Permit is not valid', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const depositAmount = initialLimit; - const deadline = (await helpers.time.latest()) - 1; - const { v, r, s } = await signErc2612Permit( - token, - roles.randomPerson, - prepaymentDepository.address, - depositAmount, - deadline - ); - await expect( - prepaymentDepository - .connect(roles.randomPerson) - .applyPermitAndDeposit(roles.user.address, depositAmount, deadline, v, r, s) - ).to.be.revertedWith('ERC20Permit: expired deadline'); - }); - }); - }); - - describe('withdraw', function () { - context('Amount is not zero', function () { - context('It is before expiration timestamp', function () { - context('Withdrawal with hash has not been executed', function () { - context('Signature is reported to belong to the manager', function () { - context('Signature is valid', function () { - context('Amount does not exceed withdrawal limit', function () { - context('User has not set a withdrawal destination', function () { - context('Transfer is successful', function () { - it('withdraws', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(withdrawalAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.sub(withdrawalAmount); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { withdrawalHash, signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - const { - withdrawalDestination: returnedWithdrawalDestination, - withdrawalLimit: returnedWithdrawalLimit, - } = await prepaymentDepository - .connect(roles.user) - .callStatic.withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature); - expect(returnedWithdrawalDestination).to.equal(roles.user.address); - expect(returnedWithdrawalLimit).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ) - .to.emit(prepaymentDepository, 'Withdrew') - .withArgs( - roles.user.address, - withdrawalHash, - withdrawalAmount, - expirationTimestamp, - roles.manager.address, - roles.user.address, - expectedLimit - ); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal( - expectedLimit - ); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - await prepaymentDepository.connect(roles.manager).claim(roles.manager.address, initialBalance); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - context('User has set a withdrawal destination', function () { - context('Transfer is successful', function () { - it('withdraws', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(withdrawalAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.sub(withdrawalAmount); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { withdrawalHash, signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - const { - withdrawalDestination: returnedWithdrawalDestination, - withdrawalLimit: returnedWithdrawalLimit, - } = await prepaymentDepository - .connect(roles.user) - .callStatic.withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature); - expect(returnedWithdrawalDestination).to.equal(roles.withdrawalDestination.address); - expect(returnedWithdrawalLimit).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ) - .to.emit(prepaymentDepository, 'Withdrew') - .withArgs( - roles.user.address, - withdrawalHash, - withdrawalAmount, - expirationTimestamp, - roles.manager.address, - roles.withdrawalDestination.address, - expectedLimit - ); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal( - expectedLimit - ); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - await prepaymentDepository.connect(roles.manager).claim(roles.manager.address, initialBalance); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - }); - context('Amount exceeds withdrawal limit', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.mul(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('Amount exceeds limit'); - }); - }); - }); - context('Signature is not valid', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.mul(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, '0x123456') - ).to.be.revertedWith('ECDSA: invalid signature length'); - }); - }); - }); - context('Signature is reported to belong to a withdrawal signer', function () { - context('Signature is valid', function () { - context('Amount does not exceed withdrawal limit', function () { - context('User has not set a withdrawal destination', function () { - context('Transfer is successful', function () { - it('withdraws', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(withdrawalAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.sub(withdrawalAmount); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { withdrawalHash, signature } = await signWithdrawal( - prepaymentDepository, - roles.withdrawalSigner, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - const { - withdrawalDestination: returnedWithdrawalDestination, - withdrawalLimit: returnedWithdrawalLimit, - } = await prepaymentDepository - .connect(roles.user) - .callStatic.withdraw( - withdrawalAmount, - expirationTimestamp, - roles.withdrawalSigner.address, - signature - ); - expect(returnedWithdrawalDestination).to.equal(roles.user.address); - expect(returnedWithdrawalLimit).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, signature) - ) - .to.emit(prepaymentDepository, 'Withdrew') - .withArgs( - roles.user.address, - withdrawalHash, - withdrawalAmount, - expirationTimestamp, - roles.withdrawalSigner.address, - roles.user.address, - expectedLimit - ); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal( - expectedLimit - ); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - await prepaymentDepository.connect(roles.manager).claim(roles.manager.address, initialBalance); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.withdrawalSigner, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, signature) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - context('User has set a withdrawal destination', function () { - context('Transfer is successful', function () { - it('withdraws', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expectedLimit = initialLimit.sub(withdrawalAmount); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - const expectedBalance = initialBalance.sub(withdrawalAmount); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { withdrawalHash, signature } = await signWithdrawal( - prepaymentDepository, - roles.withdrawalSigner, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - const { - withdrawalDestination: returnedWithdrawalDestination, - withdrawalLimit: returnedWithdrawalLimit, - } = await prepaymentDepository - .connect(roles.user) - .callStatic.withdraw( - withdrawalAmount, - expirationTimestamp, - roles.withdrawalSigner.address, - signature - ); - expect(returnedWithdrawalDestination).to.equal(roles.withdrawalDestination.address); - expect(returnedWithdrawalLimit).to.equal(expectedLimit); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, signature) - ) - .to.emit(prepaymentDepository, 'Withdrew') - .withArgs( - roles.user.address, - withdrawalHash, - withdrawalAmount, - expirationTimestamp, - roles.withdrawalSigner.address, - roles.withdrawalDestination.address, - expectedLimit - ); - expect(await prepaymentDepository.userToWithdrawalLimit(roles.user.address)).to.be.equal( - expectedLimit - ); - expect(await token.balanceOf(prepaymentDepository.address)).to.be.equal(expectedBalance); - }); - }); - context('Transfer is not successful', function () { - it('reverts', async function () { - const { roles, token, prepaymentDepository } = await helpers.loadFixture(deploy); - await prepaymentDepository - .connect(roles.user) - .setWithdrawalDestination(roles.user.address, roles.withdrawalDestination.address); - const initialBalance = await token.balanceOf(prepaymentDepository.address); - await prepaymentDepository.connect(roles.manager).claim(roles.manager.address, initialBalance); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.withdrawalSigner, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, signature) - ).to.be.revertedWith('ERC20: transfer amount exceeds balance'); - }); - }); - }); - }); - context('Amount exceeds withdrawal limit', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.mul(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.withdrawalSigner, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, signature) - ).to.be.revertedWith('Amount exceeds limit'); - }); - }); - }); - context('Signature is not valid', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.mul(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.withdrawalSigner.address, '0x123456') - ).to.be.revertedWith('ECDSA: invalid signature length'); - }); - }); - }); - context('Signature is not reported to belong to the manager or a withdrawal signer', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.randomPerson, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.randomPerson.address, signature) - ).to.be.revertedWith('Cannot sign withdrawal'); - }); - }); - }); - context('Withdrawal with hash has been executed', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('Withdrawal already executed'); - }); - }); - }); - context('It is not before expiration timestamp', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const initialLimit = await prepaymentDepository.userToWithdrawalLimit(roles.user.address); - const withdrawalAmount = initialLimit.div(2); - const expirationTimestamp = (await helpers.time.latest()) - 1; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('Signature expired'); - }); - }); - }); - context('Amount is zero', function () { - it('reverts', async function () { - const { roles, prepaymentDepository } = await helpers.loadFixture(deploy); - const withdrawalAmount = 0; - const expirationTimestamp = (await helpers.time.latest()) + 60 * 60; - const { signature } = await signWithdrawal( - prepaymentDepository, - roles.manager, - roles.user.address, - withdrawalAmount, - expirationTimestamp - ); - await expect( - prepaymentDepository - .connect(roles.user) - .withdraw(withdrawalAmount, expirationTimestamp, roles.manager.address, signature) - ).to.be.revertedWith('Amount zero'); - }); - }); - }); -});